indexea_client 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +3413 -0
  4. data/Rakefile +8 -0
  5. data/docs/AccountApi.md +685 -0
  6. data/docs/AccountBean.md +27 -0
  7. data/docs/AccountPasswdBody.md +8 -0
  8. data/docs/AccountPortraitBody.md +7 -0
  9. data/docs/AccountProfileBody.md +8 -0
  10. data/docs/AccountResetpwdBody.md +9 -0
  11. data/docs/AccountSigninBody.md +9 -0
  12. data/docs/AccountSignupBody.md +10 -0
  13. data/docs/AccountsFeedbackBody.md +8 -0
  14. data/docs/AccountsMessageBody.md +8 -0
  15. data/docs/AnalyzeObject.md +8 -0
  16. data/docs/AnalyzeToken.md +11 -0
  17. data/docs/AppBean.md +23 -0
  18. data/docs/AppCompanyBody.md +22 -0
  19. data/docs/AppIndexBody.md +7 -0
  20. data/docs/AppLogAccount.md +9 -0
  21. data/docs/AppLogBean.md +19 -0
  22. data/docs/AppLogsBean.md +9 -0
  23. data/docs/AppMentorBean.md +14 -0
  24. data/docs/AppOauthBody.md +7 -0
  25. data/docs/AppOauthBody1.md +7 -0
  26. data/docs/AppOauthresetsecretBody.md +7 -0
  27. data/docs/AppTokensBody.md +7 -0
  28. data/docs/AppTokensBody1.md +7 -0
  29. data/docs/AppWidgetBody.md +7 -0
  30. data/docs/AppsApi.md +1843 -0
  31. data/docs/AppsAppBody.md +8 -0
  32. data/docs/AppsBody.md +8 -0
  33. data/docs/AutoCompleteItem.md +9 -0
  34. data/docs/BlacklistBean.md +12 -0
  35. data/docs/Bulletin.md +15 -0
  36. data/docs/CompanyBean.md +24 -0
  37. data/docs/ContactForm.md +11 -0
  38. data/docs/CrawlerLog.md +14 -0
  39. data/docs/CrawlerLogs.md +8 -0
  40. data/docs/CrawlerTask.md +16 -0
  41. data/docs/FieldsApi.md +215 -0
  42. data/docs/GlobalApi.md +258 -0
  43. data/docs/GlobalOptionForm.md +8 -0
  44. data/docs/IndexBean.md +26 -0
  45. data/docs/IndexFieldBean.md +8 -0
  46. data/docs/IndexForm.md +15 -0
  47. data/docs/IndexRebuildForm.md +12 -0
  48. data/docs/IndexSettings.md +10 -0
  49. data/docs/IndexSettingsBody.md +7 -0
  50. data/docs/IndexStatBean.md +14 -0
  51. data/docs/IndexSynonymsflushBody.md +7 -0
  52. data/docs/IndexTask.md +13 -0
  53. data/docs/IndexTemplate.md +17 -0
  54. data/docs/IndexTemplates.md +8 -0
  55. data/docs/IndexUploadBody.md +7 -0
  56. data/docs/IndicesApi.md +1620 -0
  57. data/docs/IntelligentMapping.md +8 -0
  58. data/docs/KeywordBindingBean.md +14 -0
  59. data/docs/MentorForm.md +8 -0
  60. data/docs/Message.md +18 -0
  61. data/docs/MessageApi.md +262 -0
  62. data/docs/Messages.md +8 -0
  63. data/docs/OauthAppBean.md +20 -0
  64. data/docs/OpenidBean.md +10 -0
  65. data/docs/OptionForm.md +10 -0
  66. data/docs/OrdersIdentBody.md +7 -0
  67. data/docs/PayResult.md +9 -0
  68. data/docs/PaymentApi.md +788 -0
  69. data/docs/PaymentInvoice.md +15 -0
  70. data/docs/PaymentOrder.md +25 -0
  71. data/docs/PaymentRecord.md +13 -0
  72. data/docs/PaymentService.md +12 -0
  73. data/docs/QueriesApi.md +1821 -0
  74. data/docs/QueryActionBean.md +27 -0
  75. data/docs/QueryBean.md +22 -0
  76. data/docs/QueryForm.md +15 -0
  77. data/docs/QueryNode.md +10 -0
  78. data/docs/QuerySortField.md +9 -0
  79. data/docs/QueryVariableBean.md +17 -0
  80. data/docs/RecommendApi.md +365 -0
  81. data/docs/RecommendBean.md +18 -0
  82. data/docs/RecordFilter.md +10 -0
  83. data/docs/RecordsApi.md +286 -0
  84. data/docs/SearchApi.md +646 -0
  85. data/docs/SearchEstimateResult.md +11 -0
  86. data/docs/SearchWord.md +8 -0
  87. data/docs/StatIndexBean.md +14 -0
  88. data/docs/StatsApi.md +245 -0
  89. data/docs/SynonymsBean.md +14 -0
  90. data/docs/TokenBean.md +12 -0
  91. data/docs/TriggerBean.md +13 -0
  92. data/docs/TriggerLogBean.md +15 -0
  93. data/docs/ValueOfField.md +8 -0
  94. data/docs/WidgetBean.md +21 -0
  95. data/docs/WidgetForm.md +13 -0
  96. data/docs/WidgetLogo.md +7 -0
  97. data/docs/WidgetLogoBody.md +7 -0
  98. data/docs/WidgetStatusForm.md +8 -0
  99. data/docs/WidgetsApi.md +573 -0
  100. data/git_push.sh +55 -0
  101. data/indexea_client.gemspec +38 -0
  102. data/lib/indexea_client/api/account_api.rb +846 -0
  103. data/lib/indexea_client/api/apps_api.rb +2271 -0
  104. data/lib/indexea_client/api/fields_api.rb +289 -0
  105. data/lib/indexea_client/api/global_api.rb +326 -0
  106. data/lib/indexea_client/api/indices_api.rb +2076 -0
  107. data/lib/indexea_client/api/message_api.rb +337 -0
  108. data/lib/indexea_client/api/payment_api.rb +975 -0
  109. data/lib/indexea_client/api/queries_api.rb +2320 -0
  110. data/lib/indexea_client/api/recommend_api.rb +461 -0
  111. data/lib/indexea_client/api/records_api.rb +375 -0
  112. data/lib/indexea_client/api/search_api.rb +892 -0
  113. data/lib/indexea_client/api/stats_api.rb +312 -0
  114. data/lib/indexea_client/api/widgets_api.rb +741 -0
  115. data/lib/indexea_client/api_client.rb +391 -0
  116. data/lib/indexea_client/api_error.rb +57 -0
  117. data/lib/indexea_client/configuration.rb +205 -0
  118. data/lib/indexea_client/models/account_bean.rb +396 -0
  119. data/lib/indexea_client/models/account_passwd_body.rb +227 -0
  120. data/lib/indexea_client/models/account_portrait_body.rb +206 -0
  121. data/lib/indexea_client/models/account_profile_body.rb +228 -0
  122. data/lib/indexea_client/models/account_resetpwd_body.rb +240 -0
  123. data/lib/indexea_client/models/account_signin_body.rb +237 -0
  124. data/lib/indexea_client/models/account_signup_body.rb +254 -0
  125. data/lib/indexea_client/models/accounts_feedback_body.rb +262 -0
  126. data/lib/indexea_client/models/accounts_message_body.rb +226 -0
  127. data/lib/indexea_client/models/analyze_object.rb +216 -0
  128. data/lib/indexea_client/models/analyze_token.rb +243 -0
  129. data/lib/indexea_client/models/app_bean.rb +360 -0
  130. data/lib/indexea_client/models/app_company_body.rb +357 -0
  131. data/lib/indexea_client/models/app_index_body.rb +212 -0
  132. data/lib/indexea_client/models/app_log_account.rb +224 -0
  133. data/lib/indexea_client/models/app_log_bean.rb +318 -0
  134. data/lib/indexea_client/models/app_logs_bean.rb +229 -0
  135. data/lib/indexea_client/models/app_mentor_bean.rb +277 -0
  136. data/lib/indexea_client/models/app_oauth_body.rb +206 -0
  137. data/lib/indexea_client/models/app_oauth_body_1.rb +212 -0
  138. data/lib/indexea_client/models/app_oauthresetsecret_body.rb +212 -0
  139. data/lib/indexea_client/models/app_tokens_body.rb +212 -0
  140. data/lib/indexea_client/models/app_tokens_body_1.rb +212 -0
  141. data/lib/indexea_client/models/app_widget_body.rb +212 -0
  142. data/lib/indexea_client/models/apps_app_body.rb +216 -0
  143. data/lib/indexea_client/models/apps_body.rb +221 -0
  144. data/lib/indexea_client/models/auto_complete_item.rb +224 -0
  145. data/lib/indexea_client/models/blacklist_bean.rb +258 -0
  146. data/lib/indexea_client/models/bulletin.rb +312 -0
  147. data/lib/indexea_client/models/company_bean.rb +378 -0
  148. data/lib/indexea_client/models/contact_form.rb +258 -0
  149. data/lib/indexea_client/models/crawler_log.rb +270 -0
  150. data/lib/indexea_client/models/crawler_logs.rb +217 -0
  151. data/lib/indexea_client/models/crawler_task.rb +288 -0
  152. data/lib/indexea_client/models/global_option_form.rb +218 -0
  153. data/lib/indexea_client/models/index_bean.rb +390 -0
  154. data/lib/indexea_client/models/index_field_bean.rb +217 -0
  155. data/lib/indexea_client/models/index_form.rb +283 -0
  156. data/lib/indexea_client/models/index_rebuild_form.rb +254 -0
  157. data/lib/indexea_client/models/index_settings.rb +234 -0
  158. data/lib/indexea_client/models/index_settings_body.rb +212 -0
  159. data/lib/indexea_client/models/index_stat_bean.rb +270 -0
  160. data/lib/indexea_client/models/index_synonymsflush_body.rb +212 -0
  161. data/lib/indexea_client/models/index_task.rb +261 -0
  162. data/lib/indexea_client/models/index_template.rb +299 -0
  163. data/lib/indexea_client/models/index_templates.rb +219 -0
  164. data/lib/indexea_client/models/index_upload_body.rb +208 -0
  165. data/lib/indexea_client/models/intelligent_mapping.rb +217 -0
  166. data/lib/indexea_client/models/keyword_binding_bean.rb +274 -0
  167. data/lib/indexea_client/models/mentor_form.rb +220 -0
  168. data/lib/indexea_client/models/message.rb +306 -0
  169. data/lib/indexea_client/models/messages.rb +217 -0
  170. data/lib/indexea_client/models/oauth_app_bean.rb +329 -0
  171. data/lib/indexea_client/models/openid_bean.rb +238 -0
  172. data/lib/indexea_client/models/option_form.rb +287 -0
  173. data/lib/indexea_client/models/orders_ident_body.rb +206 -0
  174. data/lib/indexea_client/models/pay_result.rb +258 -0
  175. data/lib/indexea_client/models/payment_invoice.rb +283 -0
  176. data/lib/indexea_client/models/payment_order.rb +412 -0
  177. data/lib/indexea_client/models/payment_record.rb +261 -0
  178. data/lib/indexea_client/models/payment_service.rb +258 -0
  179. data/lib/indexea_client/models/query_action_bean.rb +391 -0
  180. data/lib/indexea_client/models/query_bean.rb +348 -0
  181. data/lib/indexea_client/models/query_form.rb +285 -0
  182. data/lib/indexea_client/models/query_node.rb +234 -0
  183. data/lib/indexea_client/models/query_sort_field.rb +264 -0
  184. data/lib/indexea_client/models/query_variable_bean.rb +335 -0
  185. data/lib/indexea_client/models/recommend_bean.rb +318 -0
  186. data/lib/indexea_client/models/record_filter.rb +242 -0
  187. data/lib/indexea_client/models/search_estimate_result.rb +242 -0
  188. data/lib/indexea_client/models/search_word.rb +218 -0
  189. data/lib/indexea_client/models/stat_index_bean.rb +270 -0
  190. data/lib/indexea_client/models/synonyms_bean.rb +274 -0
  191. data/lib/indexea_client/models/token_bean.rb +252 -0
  192. data/lib/indexea_client/models/trigger_bean.rb +263 -0
  193. data/lib/indexea_client/models/trigger_log_bean.rb +279 -0
  194. data/lib/indexea_client/models/value_of_field.rb +217 -0
  195. data/lib/indexea_client/models/widget_bean.rb +387 -0
  196. data/lib/indexea_client/models/widget_form.rb +328 -0
  197. data/lib/indexea_client/models/widget_logo.rb +206 -0
  198. data/lib/indexea_client/models/widget_logo_body.rb +206 -0
  199. data/lib/indexea_client/models/widget_status_form.rb +223 -0
  200. data/lib/indexea_client/version.rb +14 -0
  201. data/lib/indexea_client.rb +133 -0
  202. data/spec/api/account_api_spec.rb +200 -0
  203. data/spec/api/apps_api_spec.rb +492 -0
  204. data/spec/api/fields_api_spec.rb +86 -0
  205. data/spec/api/global_api_spec.rb +98 -0
  206. data/spec/api/indices_api_spec.rb +434 -0
  207. data/spec/api/message_api_spec.rb +96 -0
  208. data/spec/api/payment_api_spec.rb +227 -0
  209. data/spec/api/queries_api_spec.rb +482 -0
  210. data/spec/api/recommend_api_spec.rb +125 -0
  211. data/spec/api/records_api_spec.rb +107 -0
  212. data/spec/api/search_api_spec.rb +220 -0
  213. data/spec/api/stats_api_spec.rb +99 -0
  214. data/spec/api/widgets_api_spec.rb +174 -0
  215. data/spec/api_client_spec.rb +225 -0
  216. data/spec/base_object_spec.rb +109 -0
  217. data/spec/configuration_spec.rb +41 -0
  218. data/spec/models/account_bean_spec.rb +160 -0
  219. data/spec/models/account_passwd_body_spec.rb +46 -0
  220. data/spec/models/account_portrait_body_spec.rb +40 -0
  221. data/spec/models/account_profile_body_spec.rb +46 -0
  222. data/spec/models/account_resetpwd_body_spec.rb +52 -0
  223. data/spec/models/account_signin_body_spec.rb +52 -0
  224. data/spec/models/account_signup_body_spec.rb +58 -0
  225. data/spec/models/accounts_feedback_body_spec.rb +50 -0
  226. data/spec/models/accounts_message_body_spec.rb +46 -0
  227. data/spec/models/analyze_object_spec.rb +46 -0
  228. data/spec/models/analyze_token_spec.rb +64 -0
  229. data/spec/models/app_bean_spec.rb +136 -0
  230. data/spec/models/app_company_body_spec.rb +130 -0
  231. data/spec/models/app_index_body_spec.rb +40 -0
  232. data/spec/models/app_log_account_spec.rb +52 -0
  233. data/spec/models/app_log_bean_spec.rb +112 -0
  234. data/spec/models/app_logs_bean_spec.rb +52 -0
  235. data/spec/models/app_mentor_bean_spec.rb +82 -0
  236. data/spec/models/app_oauth_body_1_spec.rb +40 -0
  237. data/spec/models/app_oauth_body_spec.rb +40 -0
  238. data/spec/models/app_oauthresetsecret_body_spec.rb +40 -0
  239. data/spec/models/app_tokens_body_1_spec.rb +40 -0
  240. data/spec/models/app_tokens_body_spec.rb +40 -0
  241. data/spec/models/app_widget_body_spec.rb +40 -0
  242. data/spec/models/apps_app_body_spec.rb +46 -0
  243. data/spec/models/apps_body_spec.rb +46 -0
  244. data/spec/models/auto_complete_item_spec.rb +52 -0
  245. data/spec/models/blacklist_bean_spec.rb +70 -0
  246. data/spec/models/bulletin_spec.rb +92 -0
  247. data/spec/models/company_bean_spec.rb +142 -0
  248. data/spec/models/contact_form_spec.rb +64 -0
  249. data/spec/models/crawler_log_spec.rb +82 -0
  250. data/spec/models/crawler_logs_spec.rb +46 -0
  251. data/spec/models/crawler_task_spec.rb +94 -0
  252. data/spec/models/global_option_form_spec.rb +46 -0
  253. data/spec/models/index_bean_spec.rb +154 -0
  254. data/spec/models/index_field_bean_spec.rb +46 -0
  255. data/spec/models/index_form_spec.rb +88 -0
  256. data/spec/models/index_rebuild_form_spec.rb +70 -0
  257. data/spec/models/index_settings_body_spec.rb +40 -0
  258. data/spec/models/index_settings_spec.rb +58 -0
  259. data/spec/models/index_stat_bean_spec.rb +82 -0
  260. data/spec/models/index_synonymsflush_body_spec.rb +40 -0
  261. data/spec/models/index_task_spec.rb +76 -0
  262. data/spec/models/index_template_spec.rb +100 -0
  263. data/spec/models/index_templates_spec.rb +46 -0
  264. data/spec/models/index_upload_body_spec.rb +40 -0
  265. data/spec/models/intelligent_mapping_spec.rb +46 -0
  266. data/spec/models/keyword_binding_bean_spec.rb +82 -0
  267. data/spec/models/mentor_form_spec.rb +46 -0
  268. data/spec/models/message_spec.rb +106 -0
  269. data/spec/models/messages_spec.rb +46 -0
  270. data/spec/models/oauth_app_bean_spec.rb +118 -0
  271. data/spec/models/openid_bean_spec.rb +58 -0
  272. data/spec/models/option_form_spec.rb +62 -0
  273. data/spec/models/orders_ident_body_spec.rb +40 -0
  274. data/spec/models/pay_result_spec.rb +56 -0
  275. data/spec/models/payment_invoice_spec.rb +88 -0
  276. data/spec/models/payment_order_spec.rb +152 -0
  277. data/spec/models/payment_record_spec.rb +76 -0
  278. data/spec/models/payment_service_spec.rb +70 -0
  279. data/spec/models/query_action_bean_spec.rb +160 -0
  280. data/spec/models/query_bean_spec.rb +130 -0
  281. data/spec/models/query_form_spec.rb +88 -0
  282. data/spec/models/query_node_spec.rb +58 -0
  283. data/spec/models/query_sort_field_spec.rb +56 -0
  284. data/spec/models/query_variable_bean_spec.rb +104 -0
  285. data/spec/models/recommend_bean_spec.rb +106 -0
  286. data/spec/models/record_filter_spec.rb +58 -0
  287. data/spec/models/search_estimate_result_spec.rb +64 -0
  288. data/spec/models/search_word_spec.rb +46 -0
  289. data/spec/models/stat_index_bean_spec.rb +82 -0
  290. data/spec/models/synonyms_bean_spec.rb +82 -0
  291. data/spec/models/token_bean_spec.rb +70 -0
  292. data/spec/models/trigger_bean_spec.rb +76 -0
  293. data/spec/models/trigger_log_bean_spec.rb +88 -0
  294. data/spec/models/value_of_field_spec.rb +46 -0
  295. data/spec/models/widget_bean_spec.rb +132 -0
  296. data/spec/models/widget_form_spec.rb +84 -0
  297. data/spec/models/widget_logo_body_spec.rb +40 -0
  298. data/spec/models/widget_logo_spec.rb +40 -0
  299. data/spec/models/widget_status_form_spec.rb +46 -0
  300. data/spec/spec_helper.rb +110 -0
  301. metadata +501 -0
@@ -0,0 +1,2076 @@
1
+ =begin
2
+ #Indexea OpenAPI
3
+
4
+ #OpenAPI of Indexea
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: indexea.com@gmail.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.54
10
+ =end
11
+
12
+ module IndexeaClient
13
+ class IndicesApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # 清空索引记录
20
+ # @param app 应用标识
21
+ # @param index 索引编号
22
+ # @param vcode 验证码
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [Object]
25
+ def index_cleanup(app, index, vcode, opts = {})
26
+ data, _status_code, _headers = index_cleanup_with_http_info(app, index, vcode, opts)
27
+ data
28
+ end
29
+
30
+ # 清空索引记录
31
+ # @param app 应用标识
32
+ # @param index 索引编号
33
+ # @param vcode 验证码
34
+ # @param [Hash] opts the optional parameters
35
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
36
+ def index_cleanup_with_http_info(app, index, vcode, opts = {})
37
+ if @api_client.config.debugging
38
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_cleanup ...'
39
+ end
40
+ # verify the required parameter 'app' is set
41
+ if @api_client.config.client_side_validation && app.nil?
42
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_cleanup"
43
+ end
44
+ # verify the required parameter 'index' is set
45
+ if @api_client.config.client_side_validation && index.nil?
46
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_cleanup"
47
+ end
48
+ # verify the required parameter 'vcode' is set
49
+ if @api_client.config.client_side_validation && vcode.nil?
50
+ fail ArgumentError, "Missing the required parameter 'vcode' when calling IndicesApi.index_cleanup"
51
+ end
52
+ # resource path
53
+ local_var_path = '/indices/{app}/{index}/cleanup'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
54
+
55
+ # query parameters
56
+ query_params = opts[:query_params] || {}
57
+ query_params[:'vcode'] = vcode
58
+
59
+ # header parameters
60
+ header_params = opts[:header_params] || {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:body]
69
+
70
+ return_type = opts[:return_type] || 'Object'
71
+
72
+ auth_names = opts[:auth_names] || ['TokenAuth']
73
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => return_type)
80
+
81
+ if @api_client.config.debugging
82
+ @api_client.config.logger.debug "API called: IndicesApi#index_cleanup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
+ end
84
+ return data, status_code, headers
85
+ end
86
+ # 导出索引数据
87
+ # @param app 应用标识
88
+ # @param index 索引编号
89
+ # @param name 新索引的名称
90
+ # @param fields 是否复制字段定义
91
+ # @param queries 是否复制所有查询
92
+ # @param records 是否复制所有文档
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [IndexBean]
95
+ def index_copy_to(app, index, name, fields, queries, records, opts = {})
96
+ data, _status_code, _headers = index_copy_to_with_http_info(app, index, name, fields, queries, records, opts)
97
+ data
98
+ end
99
+
100
+ # 导出索引数据
101
+ # @param app 应用标识
102
+ # @param index 索引编号
103
+ # @param name 新索引的名称
104
+ # @param fields 是否复制字段定义
105
+ # @param queries 是否复制所有查询
106
+ # @param records 是否复制所有文档
107
+ # @param [Hash] opts the optional parameters
108
+ # @return [Array<(IndexBean, Integer, Hash)>] IndexBean data, response status code and response headers
109
+ def index_copy_to_with_http_info(app, index, name, fields, queries, records, opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_copy_to ...'
112
+ end
113
+ # verify the required parameter 'app' is set
114
+ if @api_client.config.client_side_validation && app.nil?
115
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_copy_to"
116
+ end
117
+ # verify the required parameter 'index' is set
118
+ if @api_client.config.client_side_validation && index.nil?
119
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_copy_to"
120
+ end
121
+ # verify the required parameter 'name' is set
122
+ if @api_client.config.client_side_validation && name.nil?
123
+ fail ArgumentError, "Missing the required parameter 'name' when calling IndicesApi.index_copy_to"
124
+ end
125
+ # verify the required parameter 'fields' is set
126
+ if @api_client.config.client_side_validation && fields.nil?
127
+ fail ArgumentError, "Missing the required parameter 'fields' when calling IndicesApi.index_copy_to"
128
+ end
129
+ # verify the required parameter 'queries' is set
130
+ if @api_client.config.client_side_validation && queries.nil?
131
+ fail ArgumentError, "Missing the required parameter 'queries' when calling IndicesApi.index_copy_to"
132
+ end
133
+ # verify the required parameter 'records' is set
134
+ if @api_client.config.client_side_validation && records.nil?
135
+ fail ArgumentError, "Missing the required parameter 'records' when calling IndicesApi.index_copy_to"
136
+ end
137
+ # resource path
138
+ local_var_path = '/indices/{app}/{index}/copyto'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
139
+
140
+ # query parameters
141
+ query_params = opts[:query_params] || {}
142
+ query_params[:'name'] = name
143
+ query_params[:'fields'] = fields
144
+ query_params[:'queries'] = queries
145
+ query_params[:'records'] = records
146
+
147
+ # header parameters
148
+ header_params = opts[:header_params] || {}
149
+ # HTTP header 'Accept' (if needed)
150
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
151
+
152
+ # form parameters
153
+ form_params = opts[:form_params] || {}
154
+
155
+ # http body (model)
156
+ post_body = opts[:body]
157
+
158
+ return_type = opts[:return_type] || 'IndexBean'
159
+
160
+ auth_names = opts[:auth_names] || ['TokenAuth']
161
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
162
+ :header_params => header_params,
163
+ :query_params => query_params,
164
+ :form_params => form_params,
165
+ :body => post_body,
166
+ :auth_names => auth_names,
167
+ :return_type => return_type)
168
+
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug "API called: IndicesApi#index_copy_to\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
171
+ end
172
+ return data, status_code, headers
173
+ end
174
+ # 创建索引
175
+ # @param body
176
+ # @param app 应用标识
177
+ # @param [Hash] opts the optional parameters
178
+ # @return [IndexBean]
179
+ def index_create(body, app, opts = {})
180
+ data, _status_code, _headers = index_create_with_http_info(body, app, opts)
181
+ data
182
+ end
183
+
184
+ # 创建索引
185
+ # @param body
186
+ # @param app 应用标识
187
+ # @param [Hash] opts the optional parameters
188
+ # @return [Array<(IndexBean, Integer, Hash)>] IndexBean data, response status code and response headers
189
+ def index_create_with_http_info(body, app, opts = {})
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_create ...'
192
+ end
193
+ # verify the required parameter 'body' is set
194
+ if @api_client.config.client_side_validation && body.nil?
195
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.index_create"
196
+ end
197
+ # verify the required parameter 'app' is set
198
+ if @api_client.config.client_side_validation && app.nil?
199
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_create"
200
+ end
201
+ # resource path
202
+ local_var_path = '/indices/{app}'.sub('{' + 'app' + '}', app.to_s)
203
+
204
+ # query parameters
205
+ query_params = opts[:query_params] || {}
206
+
207
+ # header parameters
208
+ header_params = opts[:header_params] || {}
209
+ # HTTP header 'Accept' (if needed)
210
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
211
+ # HTTP header 'Content-Type'
212
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
213
+
214
+ # form parameters
215
+ form_params = opts[:form_params] || {}
216
+
217
+ # http body (model)
218
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
219
+
220
+ return_type = opts[:return_type] || 'IndexBean'
221
+
222
+ auth_names = opts[:auth_names] || ['TokenAuth']
223
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
224
+ :header_params => header_params,
225
+ :query_params => query_params,
226
+ :form_params => form_params,
227
+ :body => post_body,
228
+ :auth_names => auth_names,
229
+ :return_type => return_type)
230
+
231
+ if @api_client.config.debugging
232
+ @api_client.config.logger.debug "API called: IndicesApi#index_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
233
+ end
234
+ return data, status_code, headers
235
+ end
236
+ # 创建索引模板
237
+ # @param body
238
+ # @param [Hash] opts the optional parameters
239
+ # @return [IndexTemplate]
240
+ def index_create_template(body, opts = {})
241
+ data, _status_code, _headers = index_create_template_with_http_info(body, opts)
242
+ data
243
+ end
244
+
245
+ # 创建索引模板
246
+ # @param body
247
+ # @param [Hash] opts the optional parameters
248
+ # @return [Array<(IndexTemplate, Integer, Hash)>] IndexTemplate data, response status code and response headers
249
+ def index_create_template_with_http_info(body, opts = {})
250
+ if @api_client.config.debugging
251
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_create_template ...'
252
+ end
253
+ # verify the required parameter 'body' is set
254
+ if @api_client.config.client_side_validation && body.nil?
255
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.index_create_template"
256
+ end
257
+ # resource path
258
+ local_var_path = '/indices/templates'
259
+
260
+ # query parameters
261
+ query_params = opts[:query_params] || {}
262
+
263
+ # header parameters
264
+ header_params = opts[:header_params] || {}
265
+ # HTTP header 'Accept' (if needed)
266
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
267
+ # HTTP header 'Content-Type'
268
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
269
+
270
+ # form parameters
271
+ form_params = opts[:form_params] || {}
272
+
273
+ # http body (model)
274
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
275
+
276
+ return_type = opts[:return_type] || 'IndexTemplate'
277
+
278
+ auth_names = opts[:auth_names] || ['TokenAuth']
279
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
280
+ :header_params => header_params,
281
+ :query_params => query_params,
282
+ :form_params => form_params,
283
+ :body => post_body,
284
+ :auth_names => auth_names,
285
+ :return_type => return_type)
286
+
287
+ if @api_client.config.debugging
288
+ @api_client.config.logger.debug "API called: IndicesApi#index_create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
289
+ end
290
+ return data, status_code, headers
291
+ end
292
+ # 删除索引
293
+ # @param app 应用标识
294
+ # @param index 索引编号
295
+ # @param [Hash] opts the optional parameters
296
+ # @option opts [String] :vcode
297
+ # @return [BOOLEAN]
298
+ def index_delete(app, index, opts = {})
299
+ data, _status_code, _headers = index_delete_with_http_info(app, index, opts)
300
+ data
301
+ end
302
+
303
+ # 删除索引
304
+ # @param app 应用标识
305
+ # @param index 索引编号
306
+ # @param [Hash] opts the optional parameters
307
+ # @option opts [String] :vcode
308
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
309
+ def index_delete_with_http_info(app, index, opts = {})
310
+ if @api_client.config.debugging
311
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_delete ...'
312
+ end
313
+ # verify the required parameter 'app' is set
314
+ if @api_client.config.client_side_validation && app.nil?
315
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_delete"
316
+ end
317
+ # verify the required parameter 'index' is set
318
+ if @api_client.config.client_side_validation && index.nil?
319
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_delete"
320
+ end
321
+ # resource path
322
+ local_var_path = '/indices/{app}/{index}'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
323
+
324
+ # query parameters
325
+ query_params = opts[:query_params] || {}
326
+
327
+ # header parameters
328
+ header_params = opts[:header_params] || {}
329
+ # HTTP header 'Accept' (if needed)
330
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
331
+ # HTTP header 'Content-Type'
332
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
333
+
334
+ # form parameters
335
+ form_params = opts[:form_params] || {}
336
+ form_params['vcode'] = opts[:'vcode'] if !opts[:'vcode'].nil?
337
+
338
+ # http body (model)
339
+ post_body = opts[:body]
340
+
341
+ return_type = opts[:return_type] || 'BOOLEAN'
342
+
343
+ auth_names = opts[:auth_names] || ['TokenAuth']
344
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
345
+ :header_params => header_params,
346
+ :query_params => query_params,
347
+ :form_params => form_params,
348
+ :body => post_body,
349
+ :auth_names => auth_names,
350
+ :return_type => return_type)
351
+
352
+ if @api_client.config.debugging
353
+ @api_client.config.logger.debug "API called: IndicesApi#index_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
354
+ end
355
+ return data, status_code, headers
356
+ end
357
+ # 删除索引的数据爬取任务
358
+ # @param app 应用标识
359
+ # @param index 索引编号
360
+ # @param [Hash] opts the optional parameters
361
+ # @return [BOOLEAN]
362
+ def index_delete_crawler_task(app, index, opts = {})
363
+ data, _status_code, _headers = index_delete_crawler_task_with_http_info(app, index, opts)
364
+ data
365
+ end
366
+
367
+ # 删除索引的数据爬取任务
368
+ # @param app 应用标识
369
+ # @param index 索引编号
370
+ # @param [Hash] opts the optional parameters
371
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
372
+ def index_delete_crawler_task_with_http_info(app, index, opts = {})
373
+ if @api_client.config.debugging
374
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_delete_crawler_task ...'
375
+ end
376
+ # verify the required parameter 'app' is set
377
+ if @api_client.config.client_side_validation && app.nil?
378
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_delete_crawler_task"
379
+ end
380
+ # verify the required parameter 'index' is set
381
+ if @api_client.config.client_side_validation && index.nil?
382
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_delete_crawler_task"
383
+ end
384
+ # resource path
385
+ local_var_path = '/indices/{app}/{index}/crawler-settings'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
386
+
387
+ # query parameters
388
+ query_params = opts[:query_params] || {}
389
+
390
+ # header parameters
391
+ header_params = opts[:header_params] || {}
392
+ # HTTP header 'Accept' (if needed)
393
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
394
+
395
+ # form parameters
396
+ form_params = opts[:form_params] || {}
397
+
398
+ # http body (model)
399
+ post_body = opts[:body]
400
+
401
+ return_type = opts[:return_type] || 'BOOLEAN'
402
+
403
+ auth_names = opts[:auth_names] || ['TokenAuth']
404
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
405
+ :header_params => header_params,
406
+ :query_params => query_params,
407
+ :form_params => form_params,
408
+ :body => post_body,
409
+ :auth_names => auth_names,
410
+ :return_type => return_type)
411
+
412
+ if @api_client.config.debugging
413
+ @api_client.config.logger.debug "API called: IndicesApi#index_delete_crawler_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
414
+ end
415
+ return data, status_code, headers
416
+ end
417
+ # 删除索引模板
418
+ # @param id
419
+ # @param [Hash] opts the optional parameters
420
+ # @return [BOOLEAN]
421
+ def index_delete_template(id, opts = {})
422
+ data, _status_code, _headers = index_delete_template_with_http_info(id, opts)
423
+ data
424
+ end
425
+
426
+ # 删除索引模板
427
+ # @param id
428
+ # @param [Hash] opts the optional parameters
429
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
430
+ def index_delete_template_with_http_info(id, opts = {})
431
+ if @api_client.config.debugging
432
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_delete_template ...'
433
+ end
434
+ # verify the required parameter 'id' is set
435
+ if @api_client.config.client_side_validation && id.nil?
436
+ fail ArgumentError, "Missing the required parameter 'id' when calling IndicesApi.index_delete_template"
437
+ end
438
+ # resource path
439
+ local_var_path = '/indices/templates'
440
+
441
+ # query parameters
442
+ query_params = opts[:query_params] || {}
443
+ query_params[:'id'] = id
444
+
445
+ # header parameters
446
+ header_params = opts[:header_params] || {}
447
+ # HTTP header 'Accept' (if needed)
448
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
449
+
450
+ # form parameters
451
+ form_params = opts[:form_params] || {}
452
+
453
+ # http body (model)
454
+ post_body = opts[:body]
455
+
456
+ return_type = opts[:return_type] || 'BOOLEAN'
457
+
458
+ auth_names = opts[:auth_names] || ['TokenAuth']
459
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
460
+ :header_params => header_params,
461
+ :query_params => query_params,
462
+ :form_params => form_params,
463
+ :body => post_body,
464
+ :auth_names => auth_names,
465
+ :return_type => return_type)
466
+
467
+ if @api_client.config.debugging
468
+ @api_client.config.logger.debug "API called: IndicesApi#index_delete_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
469
+ end
470
+ return data, status_code, headers
471
+ end
472
+ # 导出索引数据
473
+ # @param app 应用标识
474
+ # @param index 索引编号
475
+ # @param format 导出数据的格式
476
+ # @param [Hash] opts the optional parameters
477
+ # @return [BOOLEAN]
478
+ def index_export(app, index, format, opts = {})
479
+ data, _status_code, _headers = index_export_with_http_info(app, index, format, opts)
480
+ data
481
+ end
482
+
483
+ # 导出索引数据
484
+ # @param app 应用标识
485
+ # @param index 索引编号
486
+ # @param format 导出数据的格式
487
+ # @param [Hash] opts the optional parameters
488
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
489
+ def index_export_with_http_info(app, index, format, opts = {})
490
+ if @api_client.config.debugging
491
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_export ...'
492
+ end
493
+ # verify the required parameter 'app' is set
494
+ if @api_client.config.client_side_validation && app.nil?
495
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_export"
496
+ end
497
+ # verify the required parameter 'index' is set
498
+ if @api_client.config.client_side_validation && index.nil?
499
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_export"
500
+ end
501
+ # verify the required parameter 'format' is set
502
+ if @api_client.config.client_side_validation && format.nil?
503
+ fail ArgumentError, "Missing the required parameter 'format' when calling IndicesApi.index_export"
504
+ end
505
+ # verify enum value
506
+ if @api_client.config.client_side_validation && !['json', 'csv', 'excel'].include?(format)
507
+ fail ArgumentError, "invalid value for 'format', must be one of json, csv, excel"
508
+ end
509
+ # resource path
510
+ local_var_path = '/indices/{app}/{index}/export'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
511
+
512
+ # query parameters
513
+ query_params = opts[:query_params] || {}
514
+ query_params[:'format'] = format
515
+
516
+ # header parameters
517
+ header_params = opts[:header_params] || {}
518
+ # HTTP header 'Accept' (if needed)
519
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
520
+
521
+ # form parameters
522
+ form_params = opts[:form_params] || {}
523
+
524
+ # http body (model)
525
+ post_body = opts[:body]
526
+
527
+ return_type = opts[:return_type] || 'BOOLEAN'
528
+
529
+ auth_names = opts[:auth_names] || ['TokenAuth']
530
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
531
+ :header_params => header_params,
532
+ :query_params => query_params,
533
+ :form_params => form_params,
534
+ :body => post_body,
535
+ :auth_names => auth_names,
536
+ :return_type => return_type)
537
+
538
+ if @api_client.config.debugging
539
+ @api_client.config.logger.debug "API called: IndicesApi#index_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
540
+ end
541
+ return data, status_code, headers
542
+ end
543
+ # 刷新索引数据,主要用于将内存中的索引数据写入磁盘
544
+ # @param app 应用标识
545
+ # @param index 索引编号
546
+ # @param [Hash] opts the optional parameters
547
+ # @return [BOOLEAN]
548
+ def index_flush(app, index, opts = {})
549
+ data, _status_code, _headers = index_flush_with_http_info(app, index, opts)
550
+ data
551
+ end
552
+
553
+ # 刷新索引数据,主要用于将内存中的索引数据写入磁盘
554
+ # @param app 应用标识
555
+ # @param index 索引编号
556
+ # @param [Hash] opts the optional parameters
557
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
558
+ def index_flush_with_http_info(app, index, opts = {})
559
+ if @api_client.config.debugging
560
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_flush ...'
561
+ end
562
+ # verify the required parameter 'app' is set
563
+ if @api_client.config.client_side_validation && app.nil?
564
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_flush"
565
+ end
566
+ # verify the required parameter 'index' is set
567
+ if @api_client.config.client_side_validation && index.nil?
568
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_flush"
569
+ end
570
+ # resource path
571
+ local_var_path = '/indices/{app}/{index}/flush'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
572
+
573
+ # query parameters
574
+ query_params = opts[:query_params] || {}
575
+
576
+ # header parameters
577
+ header_params = opts[:header_params] || {}
578
+ # HTTP header 'Accept' (if needed)
579
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
580
+
581
+ # form parameters
582
+ form_params = opts[:form_params] || {}
583
+
584
+ # http body (model)
585
+ post_body = opts[:body]
586
+
587
+ return_type = opts[:return_type] || 'BOOLEAN'
588
+
589
+ auth_names = opts[:auth_names] || ['TokenAuth']
590
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
591
+ :header_params => header_params,
592
+ :query_params => query_params,
593
+ :form_params => form_params,
594
+ :body => post_body,
595
+ :auth_names => auth_names,
596
+ :return_type => return_type)
597
+
598
+ if @api_client.config.debugging
599
+ @api_client.config.logger.debug "API called: IndicesApi#index_flush\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
600
+ end
601
+ return data, status_code, headers
602
+ end
603
+ # 写入设置信息到索引
604
+ # @param type 设置类型
605
+ # @param app 应用标识
606
+ # @param index 索引编号
607
+ # @param [Hash] opts the optional parameters
608
+ # @option opts [String] :password
609
+ # @return [Object]
610
+ def index_flush_settings(type, app, index, opts = {})
611
+ data, _status_code, _headers = index_flush_settings_with_http_info(type, app, index, opts)
612
+ data
613
+ end
614
+
615
+ # 写入设置信息到索引
616
+ # @param type 设置类型
617
+ # @param app 应用标识
618
+ # @param index 索引编号
619
+ # @param [Hash] opts the optional parameters
620
+ # @option opts [String] :password
621
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
622
+ def index_flush_settings_with_http_info(type, app, index, opts = {})
623
+ if @api_client.config.debugging
624
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_flush_settings ...'
625
+ end
626
+ # verify the required parameter 'type' is set
627
+ if @api_client.config.client_side_validation && type.nil?
628
+ fail ArgumentError, "Missing the required parameter 'type' when calling IndicesApi.index_flush_settings"
629
+ end
630
+ # verify the required parameter 'app' is set
631
+ if @api_client.config.client_side_validation && app.nil?
632
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_flush_settings"
633
+ end
634
+ # verify the required parameter 'index' is set
635
+ if @api_client.config.client_side_validation && index.nil?
636
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_flush_settings"
637
+ end
638
+ # resource path
639
+ local_var_path = '/indices/{app}/{index}/settings'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
640
+
641
+ # query parameters
642
+ query_params = opts[:query_params] || {}
643
+ query_params[:'type'] = type
644
+
645
+ # header parameters
646
+ header_params = opts[:header_params] || {}
647
+ # HTTP header 'Accept' (if needed)
648
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
649
+ # HTTP header 'Content-Type'
650
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
651
+
652
+ # form parameters
653
+ form_params = opts[:form_params] || {}
654
+ form_params['password'] = opts[:'password'] if !opts[:'password'].nil?
655
+
656
+ # http body (model)
657
+ post_body = opts[:body]
658
+
659
+ return_type = opts[:return_type] || 'Object'
660
+
661
+ auth_names = opts[:auth_names] || ['TokenAuth']
662
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
663
+ :header_params => header_params,
664
+ :query_params => query_params,
665
+ :form_params => form_params,
666
+ :body => post_body,
667
+ :auth_names => auth_names,
668
+ :return_type => return_type)
669
+
670
+ if @api_client.config.debugging
671
+ @api_client.config.logger.debug "API called: IndicesApi#index_flush_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
672
+ end
673
+ return data, status_code, headers
674
+ end
675
+ # 获取单个索引详情
676
+ # @param app 应用标识
677
+ # @param index 索引编号
678
+ # @param [Hash] opts the optional parameters
679
+ # @return [IndexBean]
680
+ def index_get(app, index, opts = {})
681
+ data, _status_code, _headers = index_get_with_http_info(app, index, opts)
682
+ data
683
+ end
684
+
685
+ # 获取单个索引详情
686
+ # @param app 应用标识
687
+ # @param index 索引编号
688
+ # @param [Hash] opts the optional parameters
689
+ # @return [Array<(IndexBean, Integer, Hash)>] IndexBean data, response status code and response headers
690
+ def index_get_with_http_info(app, index, opts = {})
691
+ if @api_client.config.debugging
692
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_get ...'
693
+ end
694
+ # verify the required parameter 'app' is set
695
+ if @api_client.config.client_side_validation && app.nil?
696
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_get"
697
+ end
698
+ # verify the required parameter 'index' is set
699
+ if @api_client.config.client_side_validation && index.nil?
700
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_get"
701
+ end
702
+ # resource path
703
+ local_var_path = '/indices/{app}/{index}'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
704
+
705
+ # query parameters
706
+ query_params = opts[:query_params] || {}
707
+
708
+ # header parameters
709
+ header_params = opts[:header_params] || {}
710
+ # HTTP header 'Accept' (if needed)
711
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
712
+
713
+ # form parameters
714
+ form_params = opts[:form_params] || {}
715
+
716
+ # http body (model)
717
+ post_body = opts[:body]
718
+
719
+ return_type = opts[:return_type] || 'IndexBean'
720
+
721
+ auth_names = opts[:auth_names] || ['TokenAuth']
722
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
723
+ :header_params => header_params,
724
+ :query_params => query_params,
725
+ :form_params => form_params,
726
+ :body => post_body,
727
+ :auth_names => auth_names,
728
+ :return_type => return_type)
729
+
730
+ if @api_client.config.debugging
731
+ @api_client.config.logger.debug "API called: IndicesApi#index_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
732
+ end
733
+ return data, status_code, headers
734
+ end
735
+ # 获取索引的爬虫任务的爬取日志
736
+ # @param app 应用标识
737
+ # @param index 索引编号
738
+ # @param from
739
+ # @param size
740
+ # @param [Hash] opts the optional parameters
741
+ # @return [CrawlerLogs]
742
+ def index_get_crawler_logs(app, index, from, size, opts = {})
743
+ data, _status_code, _headers = index_get_crawler_logs_with_http_info(app, index, from, size, opts)
744
+ data
745
+ end
746
+
747
+ # 获取索引的爬虫任务的爬取日志
748
+ # @param app 应用标识
749
+ # @param index 索引编号
750
+ # @param from
751
+ # @param size
752
+ # @param [Hash] opts the optional parameters
753
+ # @return [Array<(CrawlerLogs, Integer, Hash)>] CrawlerLogs data, response status code and response headers
754
+ def index_get_crawler_logs_with_http_info(app, index, from, size, opts = {})
755
+ if @api_client.config.debugging
756
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_get_crawler_logs ...'
757
+ end
758
+ # verify the required parameter 'app' is set
759
+ if @api_client.config.client_side_validation && app.nil?
760
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_get_crawler_logs"
761
+ end
762
+ # verify the required parameter 'index' is set
763
+ if @api_client.config.client_side_validation && index.nil?
764
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_get_crawler_logs"
765
+ end
766
+ # verify the required parameter 'from' is set
767
+ if @api_client.config.client_side_validation && from.nil?
768
+ fail ArgumentError, "Missing the required parameter 'from' when calling IndicesApi.index_get_crawler_logs"
769
+ end
770
+ # verify the required parameter 'size' is set
771
+ if @api_client.config.client_side_validation && size.nil?
772
+ fail ArgumentError, "Missing the required parameter 'size' when calling IndicesApi.index_get_crawler_logs"
773
+ end
774
+ # resource path
775
+ local_var_path = '/indices/{app}/{index}/crawler-logs'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
776
+
777
+ # query parameters
778
+ query_params = opts[:query_params] || {}
779
+ query_params[:'from'] = from
780
+ query_params[:'size'] = size
781
+
782
+ # header parameters
783
+ header_params = opts[:header_params] || {}
784
+ # HTTP header 'Accept' (if needed)
785
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
786
+
787
+ # form parameters
788
+ form_params = opts[:form_params] || {}
789
+
790
+ # http body (model)
791
+ post_body = opts[:body]
792
+
793
+ return_type = opts[:return_type] || 'CrawlerLogs'
794
+
795
+ auth_names = opts[:auth_names] || ['TokenAuth']
796
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
797
+ :header_params => header_params,
798
+ :query_params => query_params,
799
+ :form_params => form_params,
800
+ :body => post_body,
801
+ :auth_names => auth_names,
802
+ :return_type => return_type)
803
+
804
+ if @api_client.config.debugging
805
+ @api_client.config.logger.debug "API called: IndicesApi#index_get_crawler_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
806
+ end
807
+ return data, status_code, headers
808
+ end
809
+ # 获取索引的爬虫任务设定
810
+ # @param app 应用标识
811
+ # @param index 索引编号
812
+ # @param [Hash] opts the optional parameters
813
+ # @return [CrawlerTask]
814
+ def index_get_crawler_task(app, index, opts = {})
815
+ data, _status_code, _headers = index_get_crawler_task_with_http_info(app, index, opts)
816
+ data
817
+ end
818
+
819
+ # 获取索引的爬虫任务设定
820
+ # @param app 应用标识
821
+ # @param index 索引编号
822
+ # @param [Hash] opts the optional parameters
823
+ # @return [Array<(CrawlerTask, Integer, Hash)>] CrawlerTask data, response status code and response headers
824
+ def index_get_crawler_task_with_http_info(app, index, opts = {})
825
+ if @api_client.config.debugging
826
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_get_crawler_task ...'
827
+ end
828
+ # verify the required parameter 'app' is set
829
+ if @api_client.config.client_side_validation && app.nil?
830
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_get_crawler_task"
831
+ end
832
+ # verify the required parameter 'index' is set
833
+ if @api_client.config.client_side_validation && index.nil?
834
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_get_crawler_task"
835
+ end
836
+ # resource path
837
+ local_var_path = '/indices/{app}/{index}/crawler-settings'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
838
+
839
+ # query parameters
840
+ query_params = opts[:query_params] || {}
841
+
842
+ # header parameters
843
+ header_params = opts[:header_params] || {}
844
+ # HTTP header 'Accept' (if needed)
845
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
846
+
847
+ # form parameters
848
+ form_params = opts[:form_params] || {}
849
+
850
+ # http body (model)
851
+ post_body = opts[:body]
852
+
853
+ return_type = opts[:return_type] || 'CrawlerTask'
854
+
855
+ auth_names = opts[:auth_names] || ['TokenAuth']
856
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
857
+ :header_params => header_params,
858
+ :query_params => query_params,
859
+ :form_params => form_params,
860
+ :body => post_body,
861
+ :auth_names => auth_names,
862
+ :return_type => return_type)
863
+
864
+ if @api_client.config.debugging
865
+ @api_client.config.logger.debug "API called: IndicesApi#index_get_crawler_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
866
+ end
867
+ return data, status_code, headers
868
+ end
869
+ # 获取索引设置信息
870
+ # @param app 应用标识
871
+ # @param index 索引编号
872
+ # @param type 设置类型
873
+ # @param [Hash] opts the optional parameters
874
+ # @return [Array<String>]
875
+ def index_get_filter_settings(app, index, type, opts = {})
876
+ data, _status_code, _headers = index_get_filter_settings_with_http_info(app, index, type, opts)
877
+ data
878
+ end
879
+
880
+ # 获取索引设置信息
881
+ # @param app 应用标识
882
+ # @param index 索引编号
883
+ # @param type 设置类型
884
+ # @param [Hash] opts the optional parameters
885
+ # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
886
+ def index_get_filter_settings_with_http_info(app, index, type, opts = {})
887
+ if @api_client.config.debugging
888
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_get_filter_settings ...'
889
+ end
890
+ # verify the required parameter 'app' is set
891
+ if @api_client.config.client_side_validation && app.nil?
892
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_get_filter_settings"
893
+ end
894
+ # verify the required parameter 'index' is set
895
+ if @api_client.config.client_side_validation && index.nil?
896
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_get_filter_settings"
897
+ end
898
+ # verify the required parameter 'type' is set
899
+ if @api_client.config.client_side_validation && type.nil?
900
+ fail ArgumentError, "Missing the required parameter 'type' when calling IndicesApi.index_get_filter_settings"
901
+ end
902
+ # verify enum value
903
+ if @api_client.config.client_side_validation && !['stopwords', 'synonyms'].include?(type)
904
+ fail ArgumentError, "invalid value for 'type', must be one of stopwords, synonyms"
905
+ end
906
+ # resource path
907
+ local_var_path = '/indices/{app}/{index}/filter-settings'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
908
+
909
+ # query parameters
910
+ query_params = opts[:query_params] || {}
911
+ query_params[:'type'] = type
912
+
913
+ # header parameters
914
+ header_params = opts[:header_params] || {}
915
+ # HTTP header 'Accept' (if needed)
916
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
917
+
918
+ # form parameters
919
+ form_params = opts[:form_params] || {}
920
+
921
+ # http body (model)
922
+ post_body = opts[:body]
923
+
924
+ return_type = opts[:return_type] || 'Array<String>'
925
+
926
+ auth_names = opts[:auth_names] || ['TokenAuth']
927
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
928
+ :header_params => header_params,
929
+ :query_params => query_params,
930
+ :form_params => form_params,
931
+ :body => post_body,
932
+ :auth_names => auth_names,
933
+ :return_type => return_type)
934
+
935
+ if @api_client.config.debugging
936
+ @api_client.config.logger.debug "API called: IndicesApi#index_get_filter_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
937
+ end
938
+ return data, status_code, headers
939
+ end
940
+ # 获取索引设置信息
941
+ # @param app 应用标识
942
+ # @param index 索引编号
943
+ # @param type 设置类型
944
+ # @param [Hash] opts the optional parameters
945
+ # @return [IndexSettings]
946
+ def index_get_settings(app, index, type, opts = {})
947
+ data, _status_code, _headers = index_get_settings_with_http_info(app, index, type, opts)
948
+ data
949
+ end
950
+
951
+ # 获取索引设置信息
952
+ # @param app 应用标识
953
+ # @param index 索引编号
954
+ # @param type 设置类型
955
+ # @param [Hash] opts the optional parameters
956
+ # @return [Array<(IndexSettings, Integer, Hash)>] IndexSettings data, response status code and response headers
957
+ def index_get_settings_with_http_info(app, index, type, opts = {})
958
+ if @api_client.config.debugging
959
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_get_settings ...'
960
+ end
961
+ # verify the required parameter 'app' is set
962
+ if @api_client.config.client_side_validation && app.nil?
963
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_get_settings"
964
+ end
965
+ # verify the required parameter 'index' is set
966
+ if @api_client.config.client_side_validation && index.nil?
967
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_get_settings"
968
+ end
969
+ # verify the required parameter 'type' is set
970
+ if @api_client.config.client_side_validation && type.nil?
971
+ fail ArgumentError, "Missing the required parameter 'type' when calling IndicesApi.index_get_settings"
972
+ end
973
+ # resource path
974
+ local_var_path = '/indices/{app}/{index}/settings'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
975
+
976
+ # query parameters
977
+ query_params = opts[:query_params] || {}
978
+ query_params[:'type'] = type
979
+
980
+ # header parameters
981
+ header_params = opts[:header_params] || {}
982
+ # HTTP header 'Accept' (if needed)
983
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
984
+
985
+ # form parameters
986
+ form_params = opts[:form_params] || {}
987
+
988
+ # http body (model)
989
+ post_body = opts[:body]
990
+
991
+ return_type = opts[:return_type] || 'IndexSettings'
992
+
993
+ auth_names = opts[:auth_names] || ['TokenAuth']
994
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
995
+ :header_params => header_params,
996
+ :query_params => query_params,
997
+ :form_params => form_params,
998
+ :body => post_body,
999
+ :auth_names => auth_names,
1000
+ :return_type => return_type)
1001
+
1002
+ if @api_client.config.debugging
1003
+ @api_client.config.logger.debug "API called: IndicesApi#index_get_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1004
+ end
1005
+ return data, status_code, headers
1006
+ end
1007
+ # 获取应用的索引列表
1008
+ # @param app 应用标识
1009
+ # @param [Hash] opts the optional parameters
1010
+ # @option opts [BOOLEAN] :stat 是否包含索引的统计信息 (default to true)
1011
+ # @return [Array<IndexBean>]
1012
+ def index_list(app, opts = {})
1013
+ data, _status_code, _headers = index_list_with_http_info(app, opts)
1014
+ data
1015
+ end
1016
+
1017
+ # 获取应用的索引列表
1018
+ # @param app 应用标识
1019
+ # @param [Hash] opts the optional parameters
1020
+ # @option opts [BOOLEAN] :stat 是否包含索引的统计信息
1021
+ # @return [Array<(Array<IndexBean>, Integer, Hash)>] Array<IndexBean> data, response status code and response headers
1022
+ def index_list_with_http_info(app, opts = {})
1023
+ if @api_client.config.debugging
1024
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_list ...'
1025
+ end
1026
+ # verify the required parameter 'app' is set
1027
+ if @api_client.config.client_side_validation && app.nil?
1028
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_list"
1029
+ end
1030
+ # resource path
1031
+ local_var_path = '/indices/{app}'.sub('{' + 'app' + '}', app.to_s)
1032
+
1033
+ # query parameters
1034
+ query_params = opts[:query_params] || {}
1035
+ query_params[:'stat'] = opts[:'stat'] if !opts[:'stat'].nil?
1036
+
1037
+ # header parameters
1038
+ header_params = opts[:header_params] || {}
1039
+ # HTTP header 'Accept' (if needed)
1040
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1041
+
1042
+ # form parameters
1043
+ form_params = opts[:form_params] || {}
1044
+
1045
+ # http body (model)
1046
+ post_body = opts[:body]
1047
+
1048
+ return_type = opts[:return_type] || 'Array<IndexBean>'
1049
+
1050
+ auth_names = opts[:auth_names] || ['TokenAuth']
1051
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1052
+ :header_params => header_params,
1053
+ :query_params => query_params,
1054
+ :form_params => form_params,
1055
+ :body => post_body,
1056
+ :auth_names => auth_names,
1057
+ :return_type => return_type)
1058
+
1059
+ if @api_client.config.debugging
1060
+ @api_client.config.logger.debug "API called: IndicesApi#index_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1061
+ end
1062
+ return data, status_code, headers
1063
+ end
1064
+ # 获取所有可用的索引模板
1065
+ # @param from
1066
+ # @param size
1067
+ # @param [Hash] opts the optional parameters
1068
+ # @return [IndexTemplates]
1069
+ def index_list_templates(from, size, opts = {})
1070
+ data, _status_code, _headers = index_list_templates_with_http_info(from, size, opts)
1071
+ data
1072
+ end
1073
+
1074
+ # 获取所有可用的索引模板
1075
+ # @param from
1076
+ # @param size
1077
+ # @param [Hash] opts the optional parameters
1078
+ # @return [Array<(IndexTemplates, Integer, Hash)>] IndexTemplates data, response status code and response headers
1079
+ def index_list_templates_with_http_info(from, size, opts = {})
1080
+ if @api_client.config.debugging
1081
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_list_templates ...'
1082
+ end
1083
+ # verify the required parameter 'from' is set
1084
+ if @api_client.config.client_side_validation && from.nil?
1085
+ fail ArgumentError, "Missing the required parameter 'from' when calling IndicesApi.index_list_templates"
1086
+ end
1087
+ # verify the required parameter 'size' is set
1088
+ if @api_client.config.client_side_validation && size.nil?
1089
+ fail ArgumentError, "Missing the required parameter 'size' when calling IndicesApi.index_list_templates"
1090
+ end
1091
+ # resource path
1092
+ local_var_path = '/indices/templates'
1093
+
1094
+ # query parameters
1095
+ query_params = opts[:query_params] || {}
1096
+ query_params[:'from'] = from
1097
+ query_params[:'size'] = size
1098
+
1099
+ # header parameters
1100
+ header_params = opts[:header_params] || {}
1101
+ # HTTP header 'Accept' (if needed)
1102
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1103
+
1104
+ # form parameters
1105
+ form_params = opts[:form_params] || {}
1106
+
1107
+ # http body (model)
1108
+ post_body = opts[:body]
1109
+
1110
+ return_type = opts[:return_type] || 'IndexTemplates'
1111
+
1112
+ auth_names = opts[:auth_names] || ['TokenAuth']
1113
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1114
+ :header_params => header_params,
1115
+ :query_params => query_params,
1116
+ :form_params => form_params,
1117
+ :body => post_body,
1118
+ :auth_names => auth_names,
1119
+ :return_type => return_type)
1120
+
1121
+ if @api_client.config.debugging
1122
+ @api_client.config.logger.debug "API called: IndicesApi#index_list_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1123
+ end
1124
+ return data, status_code, headers
1125
+ end
1126
+ # 获取目标网站内容预览
1127
+ # @param type
1128
+ # @param url
1129
+ # @param [Hash] opts the optional parameters
1130
+ # @return [Array<Object>]
1131
+ def index_prefetch(type, url, opts = {})
1132
+ data, _status_code, _headers = index_prefetch_with_http_info(type, url, opts)
1133
+ data
1134
+ end
1135
+
1136
+ # 获取目标网站内容预览
1137
+ # @param type
1138
+ # @param url
1139
+ # @param [Hash] opts the optional parameters
1140
+ # @return [Array<(Array<Object>, Integer, Hash)>] Array<Object> data, response status code and response headers
1141
+ def index_prefetch_with_http_info(type, url, opts = {})
1142
+ if @api_client.config.debugging
1143
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_prefetch ...'
1144
+ end
1145
+ # verify the required parameter 'type' is set
1146
+ if @api_client.config.client_side_validation && type.nil?
1147
+ fail ArgumentError, "Missing the required parameter 'type' when calling IndicesApi.index_prefetch"
1148
+ end
1149
+ # verify the required parameter 'url' is set
1150
+ if @api_client.config.client_side_validation && url.nil?
1151
+ fail ArgumentError, "Missing the required parameter 'url' when calling IndicesApi.index_prefetch"
1152
+ end
1153
+ # resource path
1154
+ local_var_path = '/indices/crawler'
1155
+
1156
+ # query parameters
1157
+ query_params = opts[:query_params] || {}
1158
+ query_params[:'type'] = type
1159
+ query_params[:'url'] = url
1160
+
1161
+ # header parameters
1162
+ header_params = opts[:header_params] || {}
1163
+ # HTTP header 'Accept' (if needed)
1164
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1165
+
1166
+ # form parameters
1167
+ form_params = opts[:form_params] || {}
1168
+
1169
+ # http body (model)
1170
+ post_body = opts[:body]
1171
+
1172
+ return_type = opts[:return_type] || 'Array<Object>'
1173
+
1174
+ auth_names = opts[:auth_names] || ['TokenAuth']
1175
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1176
+ :header_params => header_params,
1177
+ :query_params => query_params,
1178
+ :form_params => form_params,
1179
+ :body => post_body,
1180
+ :auth_names => auth_names,
1181
+ :return_type => return_type)
1182
+
1183
+ if @api_client.config.debugging
1184
+ @api_client.config.logger.debug "API called: IndicesApi#index_prefetch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1185
+ end
1186
+ return data, status_code, headers
1187
+ end
1188
+ # 重建索引数据
1189
+ # @param body
1190
+ # @param app 应用标识
1191
+ # @param index 索引编号
1192
+ # @param [Hash] opts the optional parameters
1193
+ # @return [IndexTask]
1194
+ def index_rebuild(body, app, index, opts = {})
1195
+ data, _status_code, _headers = index_rebuild_with_http_info(body, app, index, opts)
1196
+ data
1197
+ end
1198
+
1199
+ # 重建索引数据
1200
+ # @param body
1201
+ # @param app 应用标识
1202
+ # @param index 索引编号
1203
+ # @param [Hash] opts the optional parameters
1204
+ # @return [Array<(IndexTask, Integer, Hash)>] IndexTask data, response status code and response headers
1205
+ def index_rebuild_with_http_info(body, app, index, opts = {})
1206
+ if @api_client.config.debugging
1207
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_rebuild ...'
1208
+ end
1209
+ # verify the required parameter 'body' is set
1210
+ if @api_client.config.client_side_validation && body.nil?
1211
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.index_rebuild"
1212
+ end
1213
+ # verify the required parameter 'app' is set
1214
+ if @api_client.config.client_side_validation && app.nil?
1215
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_rebuild"
1216
+ end
1217
+ # verify the required parameter 'index' is set
1218
+ if @api_client.config.client_side_validation && index.nil?
1219
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_rebuild"
1220
+ end
1221
+ # resource path
1222
+ local_var_path = '/indices/{app}/{index}/rebuild'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1223
+
1224
+ # query parameters
1225
+ query_params = opts[:query_params] || {}
1226
+
1227
+ # header parameters
1228
+ header_params = opts[:header_params] || {}
1229
+ # HTTP header 'Accept' (if needed)
1230
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1231
+ # HTTP header 'Content-Type'
1232
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1233
+
1234
+ # form parameters
1235
+ form_params = opts[:form_params] || {}
1236
+
1237
+ # http body (model)
1238
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
1239
+
1240
+ return_type = opts[:return_type] || 'IndexTask'
1241
+
1242
+ auth_names = opts[:auth_names] || ['TokenAuth']
1243
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1244
+ :header_params => header_params,
1245
+ :query_params => query_params,
1246
+ :form_params => form_params,
1247
+ :body => post_body,
1248
+ :auth_names => auth_names,
1249
+ :return_type => return_type)
1250
+
1251
+ if @api_client.config.debugging
1252
+ @api_client.config.logger.debug "API called: IndicesApi#index_rebuild\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1253
+ end
1254
+ return data, status_code, headers
1255
+ end
1256
+ # 获取重建索引任务的详情
1257
+ # @param app 应用标识
1258
+ # @param index 索引编号
1259
+ # @param task_id 任务编号,传0则获取最新的任务信息
1260
+ # @param [Hash] opts the optional parameters
1261
+ # @return [IndexTask]
1262
+ def index_rebuild_task(app, index, task_id, opts = {})
1263
+ data, _status_code, _headers = index_rebuild_task_with_http_info(app, index, task_id, opts)
1264
+ data
1265
+ end
1266
+
1267
+ # 获取重建索引任务的详情
1268
+ # @param app 应用标识
1269
+ # @param index 索引编号
1270
+ # @param task_id 任务编号,传0则获取最新的任务信息
1271
+ # @param [Hash] opts the optional parameters
1272
+ # @return [Array<(IndexTask, Integer, Hash)>] IndexTask data, response status code and response headers
1273
+ def index_rebuild_task_with_http_info(app, index, task_id, opts = {})
1274
+ if @api_client.config.debugging
1275
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_rebuild_task ...'
1276
+ end
1277
+ # verify the required parameter 'app' is set
1278
+ if @api_client.config.client_side_validation && app.nil?
1279
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_rebuild_task"
1280
+ end
1281
+ # verify the required parameter 'index' is set
1282
+ if @api_client.config.client_side_validation && index.nil?
1283
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_rebuild_task"
1284
+ end
1285
+ # verify the required parameter 'task_id' is set
1286
+ if @api_client.config.client_side_validation && task_id.nil?
1287
+ fail ArgumentError, "Missing the required parameter 'task_id' when calling IndicesApi.index_rebuild_task"
1288
+ end
1289
+ # resource path
1290
+ local_var_path = '/indices/{app}/{index}/rebuild'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1291
+
1292
+ # query parameters
1293
+ query_params = opts[:query_params] || {}
1294
+ query_params[:'task_id'] = task_id
1295
+
1296
+ # header parameters
1297
+ header_params = opts[:header_params] || {}
1298
+ # HTTP header 'Accept' (if needed)
1299
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1300
+
1301
+ # form parameters
1302
+ form_params = opts[:form_params] || {}
1303
+
1304
+ # http body (model)
1305
+ post_body = opts[:body]
1306
+
1307
+ return_type = opts[:return_type] || 'IndexTask'
1308
+
1309
+ auth_names = opts[:auth_names] || ['TokenAuth']
1310
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1311
+ :header_params => header_params,
1312
+ :query_params => query_params,
1313
+ :form_params => form_params,
1314
+ :body => post_body,
1315
+ :auth_names => auth_names,
1316
+ :return_type => return_type)
1317
+
1318
+ if @api_client.config.debugging
1319
+ @api_client.config.logger.debug "API called: IndicesApi#index_rebuild_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1320
+ end
1321
+ return data, status_code, headers
1322
+ end
1323
+ # 提交或者更新索引的数据爬取任务
1324
+ # @param body
1325
+ # @param app 应用标识
1326
+ # @param index 索引编号
1327
+ # @param [Hash] opts the optional parameters
1328
+ # @return [CrawlerTask]
1329
+ def index_submit_crawler_task(body, app, index, opts = {})
1330
+ data, _status_code, _headers = index_submit_crawler_task_with_http_info(body, app, index, opts)
1331
+ data
1332
+ end
1333
+
1334
+ # 提交或者更新索引的数据爬取任务
1335
+ # @param body
1336
+ # @param app 应用标识
1337
+ # @param index 索引编号
1338
+ # @param [Hash] opts the optional parameters
1339
+ # @return [Array<(CrawlerTask, Integer, Hash)>] CrawlerTask data, response status code and response headers
1340
+ def index_submit_crawler_task_with_http_info(body, app, index, opts = {})
1341
+ if @api_client.config.debugging
1342
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_submit_crawler_task ...'
1343
+ end
1344
+ # verify the required parameter 'body' is set
1345
+ if @api_client.config.client_side_validation && body.nil?
1346
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.index_submit_crawler_task"
1347
+ end
1348
+ # verify the required parameter 'app' is set
1349
+ if @api_client.config.client_side_validation && app.nil?
1350
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_submit_crawler_task"
1351
+ end
1352
+ # verify the required parameter 'index' is set
1353
+ if @api_client.config.client_side_validation && index.nil?
1354
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_submit_crawler_task"
1355
+ end
1356
+ # resource path
1357
+ local_var_path = '/indices/{app}/{index}/crawler-settings'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1358
+
1359
+ # query parameters
1360
+ query_params = opts[:query_params] || {}
1361
+
1362
+ # header parameters
1363
+ header_params = opts[:header_params] || {}
1364
+ # HTTP header 'Accept' (if needed)
1365
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1366
+ # HTTP header 'Content-Type'
1367
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1368
+
1369
+ # form parameters
1370
+ form_params = opts[:form_params] || {}
1371
+
1372
+ # http body (model)
1373
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
1374
+
1375
+ return_type = opts[:return_type] || 'CrawlerTask'
1376
+
1377
+ auth_names = opts[:auth_names] || ['TokenAuth']
1378
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1379
+ :header_params => header_params,
1380
+ :query_params => query_params,
1381
+ :form_params => form_params,
1382
+ :body => post_body,
1383
+ :auth_names => auth_names,
1384
+ :return_type => return_type)
1385
+
1386
+ if @api_client.config.debugging
1387
+ @api_client.config.logger.debug "API called: IndicesApi#index_submit_crawler_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1388
+ end
1389
+ return data, status_code, headers
1390
+ end
1391
+ # 修改索引
1392
+ # @param body
1393
+ # @param app 应用标识
1394
+ # @param index 索引编号
1395
+ # @param [Hash] opts the optional parameters
1396
+ # @return [IndexBean]
1397
+ def index_update(body, app, index, opts = {})
1398
+ data, _status_code, _headers = index_update_with_http_info(body, app, index, opts)
1399
+ data
1400
+ end
1401
+
1402
+ # 修改索引
1403
+ # @param body
1404
+ # @param app 应用标识
1405
+ # @param index 索引编号
1406
+ # @param [Hash] opts the optional parameters
1407
+ # @return [Array<(IndexBean, Integer, Hash)>] IndexBean data, response status code and response headers
1408
+ def index_update_with_http_info(body, app, index, opts = {})
1409
+ if @api_client.config.debugging
1410
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_update ...'
1411
+ end
1412
+ # verify the required parameter 'body' is set
1413
+ if @api_client.config.client_side_validation && body.nil?
1414
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.index_update"
1415
+ end
1416
+ # verify the required parameter 'app' is set
1417
+ if @api_client.config.client_side_validation && app.nil?
1418
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_update"
1419
+ end
1420
+ # verify the required parameter 'index' is set
1421
+ if @api_client.config.client_side_validation && index.nil?
1422
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_update"
1423
+ end
1424
+ # resource path
1425
+ local_var_path = '/indices/{app}/{index}'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1426
+
1427
+ # query parameters
1428
+ query_params = opts[:query_params] || {}
1429
+
1430
+ # header parameters
1431
+ header_params = opts[:header_params] || {}
1432
+ # HTTP header 'Accept' (if needed)
1433
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1434
+ # HTTP header 'Content-Type'
1435
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1436
+
1437
+ # form parameters
1438
+ form_params = opts[:form_params] || {}
1439
+
1440
+ # http body (model)
1441
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
1442
+
1443
+ return_type = opts[:return_type] || 'IndexBean'
1444
+
1445
+ auth_names = opts[:auth_names] || ['TokenAuth']
1446
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
1447
+ :header_params => header_params,
1448
+ :query_params => query_params,
1449
+ :form_params => form_params,
1450
+ :body => post_body,
1451
+ :auth_names => auth_names,
1452
+ :return_type => return_type)
1453
+
1454
+ if @api_client.config.debugging
1455
+ @api_client.config.logger.debug "API called: IndicesApi#index_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1456
+ end
1457
+ return data, status_code, headers
1458
+ end
1459
+ # 更新索引设置信息
1460
+ # @param type 设置类型
1461
+ # @param app 应用标识
1462
+ # @param index 索引编号
1463
+ # @param [Hash] opts the optional parameters
1464
+ # @option opts [String] :body
1465
+ # @return [BOOLEAN]
1466
+ def index_update_settings(type, app, index, opts = {})
1467
+ data, _status_code, _headers = index_update_settings_with_http_info(type, app, index, opts)
1468
+ data
1469
+ end
1470
+
1471
+ # 更新索引设置信息
1472
+ # @param type 设置类型
1473
+ # @param app 应用标识
1474
+ # @param index 索引编号
1475
+ # @param [Hash] opts the optional parameters
1476
+ # @option opts [String] :body
1477
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
1478
+ def index_update_settings_with_http_info(type, app, index, opts = {})
1479
+ if @api_client.config.debugging
1480
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_update_settings ...'
1481
+ end
1482
+ # verify the required parameter 'type' is set
1483
+ if @api_client.config.client_side_validation && type.nil?
1484
+ fail ArgumentError, "Missing the required parameter 'type' when calling IndicesApi.index_update_settings"
1485
+ end
1486
+ # verify the required parameter 'app' is set
1487
+ if @api_client.config.client_side_validation && app.nil?
1488
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.index_update_settings"
1489
+ end
1490
+ # verify the required parameter 'index' is set
1491
+ if @api_client.config.client_side_validation && index.nil?
1492
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.index_update_settings"
1493
+ end
1494
+ # resource path
1495
+ local_var_path = '/indices/{app}/{index}/settings'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1496
+
1497
+ # query parameters
1498
+ query_params = opts[:query_params] || {}
1499
+ query_params[:'type'] = type
1500
+
1501
+ # header parameters
1502
+ header_params = opts[:header_params] || {}
1503
+ # HTTP header 'Accept' (if needed)
1504
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1505
+ # HTTP header 'Content-Type'
1506
+ header_params['Content-Type'] = @api_client.select_header_content_type(['text/plain'])
1507
+
1508
+ # form parameters
1509
+ form_params = opts[:form_params] || {}
1510
+
1511
+ # http body (model)
1512
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
1513
+
1514
+ return_type = opts[:return_type] || 'BOOLEAN'
1515
+
1516
+ auth_names = opts[:auth_names] || ['TokenAuth']
1517
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1518
+ :header_params => header_params,
1519
+ :query_params => query_params,
1520
+ :form_params => form_params,
1521
+ :body => post_body,
1522
+ :auth_names => auth_names,
1523
+ :return_type => return_type)
1524
+
1525
+ if @api_client.config.debugging
1526
+ @api_client.config.logger.debug "API called: IndicesApi#index_update_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1527
+ end
1528
+ return data, status_code, headers
1529
+ end
1530
+ # 修改索引模板
1531
+ # @param body
1532
+ # @param [Hash] opts the optional parameters
1533
+ # @return [IndexTemplate]
1534
+ def index_update_template(body, opts = {})
1535
+ data, _status_code, _headers = index_update_template_with_http_info(body, opts)
1536
+ data
1537
+ end
1538
+
1539
+ # 修改索引模板
1540
+ # @param body
1541
+ # @param [Hash] opts the optional parameters
1542
+ # @return [Array<(IndexTemplate, Integer, Hash)>] IndexTemplate data, response status code and response headers
1543
+ def index_update_template_with_http_info(body, opts = {})
1544
+ if @api_client.config.debugging
1545
+ @api_client.config.logger.debug 'Calling API: IndicesApi.index_update_template ...'
1546
+ end
1547
+ # verify the required parameter 'body' is set
1548
+ if @api_client.config.client_side_validation && body.nil?
1549
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.index_update_template"
1550
+ end
1551
+ # resource path
1552
+ local_var_path = '/indices/templates'
1553
+
1554
+ # query parameters
1555
+ query_params = opts[:query_params] || {}
1556
+
1557
+ # header parameters
1558
+ header_params = opts[:header_params] || {}
1559
+ # HTTP header 'Accept' (if needed)
1560
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1561
+ # HTTP header 'Content-Type'
1562
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1563
+
1564
+ # form parameters
1565
+ form_params = opts[:form_params] || {}
1566
+
1567
+ # http body (model)
1568
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
1569
+
1570
+ return_type = opts[:return_type] || 'IndexTemplate'
1571
+
1572
+ auth_names = opts[:auth_names] || ['TokenAuth']
1573
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
1574
+ :header_params => header_params,
1575
+ :query_params => query_params,
1576
+ :form_params => form_params,
1577
+ :body => post_body,
1578
+ :auth_names => auth_names,
1579
+ :return_type => return_type)
1580
+
1581
+ if @api_client.config.debugging
1582
+ @api_client.config.logger.debug "API called: IndicesApi#index_update_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1583
+ end
1584
+ return data, status_code, headers
1585
+ end
1586
+ # 添加同义词
1587
+ # @param body
1588
+ # @param app 应用标识
1589
+ # @param index 索引编号
1590
+ # @param [Hash] opts the optional parameters
1591
+ # @return [SynonymsBean]
1592
+ def synonyms_add(body, app, index, opts = {})
1593
+ data, _status_code, _headers = synonyms_add_with_http_info(body, app, index, opts)
1594
+ data
1595
+ end
1596
+
1597
+ # 添加同义词
1598
+ # @param body
1599
+ # @param app 应用标识
1600
+ # @param index 索引编号
1601
+ # @param [Hash] opts the optional parameters
1602
+ # @return [Array<(SynonymsBean, Integer, Hash)>] SynonymsBean data, response status code and response headers
1603
+ def synonyms_add_with_http_info(body, app, index, opts = {})
1604
+ if @api_client.config.debugging
1605
+ @api_client.config.logger.debug 'Calling API: IndicesApi.synonyms_add ...'
1606
+ end
1607
+ # verify the required parameter 'body' is set
1608
+ if @api_client.config.client_side_validation && body.nil?
1609
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.synonyms_add"
1610
+ end
1611
+ # verify the required parameter 'app' is set
1612
+ if @api_client.config.client_side_validation && app.nil?
1613
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.synonyms_add"
1614
+ end
1615
+ # verify the required parameter 'index' is set
1616
+ if @api_client.config.client_side_validation && index.nil?
1617
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.synonyms_add"
1618
+ end
1619
+ # resource path
1620
+ local_var_path = '/indices/{app}/{index}/synonyms'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1621
+
1622
+ # query parameters
1623
+ query_params = opts[:query_params] || {}
1624
+
1625
+ # header parameters
1626
+ header_params = opts[:header_params] || {}
1627
+ # HTTP header 'Accept' (if needed)
1628
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1629
+ # HTTP header 'Content-Type'
1630
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1631
+
1632
+ # form parameters
1633
+ form_params = opts[:form_params] || {}
1634
+
1635
+ # http body (model)
1636
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
1637
+
1638
+ return_type = opts[:return_type] || 'SynonymsBean'
1639
+
1640
+ auth_names = opts[:auth_names] || ['TokenAuth']
1641
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1642
+ :header_params => header_params,
1643
+ :query_params => query_params,
1644
+ :form_params => form_params,
1645
+ :body => post_body,
1646
+ :auth_names => auth_names,
1647
+ :return_type => return_type)
1648
+
1649
+ if @api_client.config.debugging
1650
+ @api_client.config.logger.debug "API called: IndicesApi#synonyms_add\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1651
+ end
1652
+ return data, status_code, headers
1653
+ end
1654
+ # 删除同义词
1655
+ # @param app 应用标识
1656
+ # @param index 索引编号
1657
+ # @param id 同义词编号
1658
+ # @param [Hash] opts the optional parameters
1659
+ # @return [BOOLEAN]
1660
+ def synonyms_delete(app, index, id, opts = {})
1661
+ data, _status_code, _headers = synonyms_delete_with_http_info(app, index, id, opts)
1662
+ data
1663
+ end
1664
+
1665
+ # 删除同义词
1666
+ # @param app 应用标识
1667
+ # @param index 索引编号
1668
+ # @param id 同义词编号
1669
+ # @param [Hash] opts the optional parameters
1670
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
1671
+ def synonyms_delete_with_http_info(app, index, id, opts = {})
1672
+ if @api_client.config.debugging
1673
+ @api_client.config.logger.debug 'Calling API: IndicesApi.synonyms_delete ...'
1674
+ end
1675
+ # verify the required parameter 'app' is set
1676
+ if @api_client.config.client_side_validation && app.nil?
1677
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.synonyms_delete"
1678
+ end
1679
+ # verify the required parameter 'index' is set
1680
+ if @api_client.config.client_side_validation && index.nil?
1681
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.synonyms_delete"
1682
+ end
1683
+ # verify the required parameter 'id' is set
1684
+ if @api_client.config.client_side_validation && id.nil?
1685
+ fail ArgumentError, "Missing the required parameter 'id' when calling IndicesApi.synonyms_delete"
1686
+ end
1687
+ # resource path
1688
+ local_var_path = '/indices/{app}/{index}/synonyms'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1689
+
1690
+ # query parameters
1691
+ query_params = opts[:query_params] || {}
1692
+ query_params[:'id'] = id
1693
+
1694
+ # header parameters
1695
+ header_params = opts[:header_params] || {}
1696
+ # HTTP header 'Accept' (if needed)
1697
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1698
+
1699
+ # form parameters
1700
+ form_params = opts[:form_params] || {}
1701
+
1702
+ # http body (model)
1703
+ post_body = opts[:body]
1704
+
1705
+ return_type = opts[:return_type] || 'BOOLEAN'
1706
+
1707
+ auth_names = opts[:auth_names] || ['TokenAuth']
1708
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
1709
+ :header_params => header_params,
1710
+ :query_params => query_params,
1711
+ :form_params => form_params,
1712
+ :body => post_body,
1713
+ :auth_names => auth_names,
1714
+ :return_type => return_type)
1715
+
1716
+ if @api_client.config.debugging
1717
+ @api_client.config.logger.debug "API called: IndicesApi#synonyms_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1718
+ end
1719
+ return data, status_code, headers
1720
+ end
1721
+ # 启用禁用同义词
1722
+ # @param app 应用标识
1723
+ # @param index 索引编号
1724
+ # @param id 同义词编号
1725
+ # @param [Hash] opts the optional parameters
1726
+ # @option opts [BOOLEAN] :enable 是否启用
1727
+ # @option opts [BOOLEAN] :all 是否对所有索引起作用
1728
+ # @return [BOOLEAN]
1729
+ def synonyms_enable(app, index, id, opts = {})
1730
+ data, _status_code, _headers = synonyms_enable_with_http_info(app, index, id, opts)
1731
+ data
1732
+ end
1733
+
1734
+ # 启用禁用同义词
1735
+ # @param app 应用标识
1736
+ # @param index 索引编号
1737
+ # @param id 同义词编号
1738
+ # @param [Hash] opts the optional parameters
1739
+ # @option opts [BOOLEAN] :enable 是否启用
1740
+ # @option opts [BOOLEAN] :all 是否对所有索引起作用
1741
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
1742
+ def synonyms_enable_with_http_info(app, index, id, opts = {})
1743
+ if @api_client.config.debugging
1744
+ @api_client.config.logger.debug 'Calling API: IndicesApi.synonyms_enable ...'
1745
+ end
1746
+ # verify the required parameter 'app' is set
1747
+ if @api_client.config.client_side_validation && app.nil?
1748
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.synonyms_enable"
1749
+ end
1750
+ # verify the required parameter 'index' is set
1751
+ if @api_client.config.client_side_validation && index.nil?
1752
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.synonyms_enable"
1753
+ end
1754
+ # verify the required parameter 'id' is set
1755
+ if @api_client.config.client_side_validation && id.nil?
1756
+ fail ArgumentError, "Missing the required parameter 'id' when calling IndicesApi.synonyms_enable"
1757
+ end
1758
+ # resource path
1759
+ local_var_path = '/indices/{app}/{index}/synonyms'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1760
+
1761
+ # query parameters
1762
+ query_params = opts[:query_params] || {}
1763
+ query_params[:'id'] = id
1764
+ query_params[:'enable'] = opts[:'enable'] if !opts[:'enable'].nil?
1765
+ query_params[:'all'] = opts[:'all'] if !opts[:'all'].nil?
1766
+
1767
+ # header parameters
1768
+ header_params = opts[:header_params] || {}
1769
+ # HTTP header 'Accept' (if needed)
1770
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1771
+
1772
+ # form parameters
1773
+ form_params = opts[:form_params] || {}
1774
+
1775
+ # http body (model)
1776
+ post_body = opts[:body]
1777
+
1778
+ return_type = opts[:return_type] || 'BOOLEAN'
1779
+
1780
+ auth_names = opts[:auth_names] || ['TokenAuth']
1781
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
1782
+ :header_params => header_params,
1783
+ :query_params => query_params,
1784
+ :form_params => form_params,
1785
+ :body => post_body,
1786
+ :auth_names => auth_names,
1787
+ :return_type => return_type)
1788
+
1789
+ if @api_client.config.debugging
1790
+ @api_client.config.logger.debug "API called: IndicesApi#synonyms_enable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1791
+ end
1792
+ return data, status_code, headers
1793
+ end
1794
+ # 将同义词更新到搜索引擎的同义词表
1795
+ # @param app 应用标识
1796
+ # @param index 索引编号
1797
+ # @param [Hash] opts the optional parameters
1798
+ # @option opts [String] :password
1799
+ # @return [Object]
1800
+ def synonyms_flush(app, index, opts = {})
1801
+ data, _status_code, _headers = synonyms_flush_with_http_info(app, index, opts)
1802
+ data
1803
+ end
1804
+
1805
+ # 将同义词更新到搜索引擎的同义词表
1806
+ # @param app 应用标识
1807
+ # @param index 索引编号
1808
+ # @param [Hash] opts the optional parameters
1809
+ # @option opts [String] :password
1810
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1811
+ def synonyms_flush_with_http_info(app, index, opts = {})
1812
+ if @api_client.config.debugging
1813
+ @api_client.config.logger.debug 'Calling API: IndicesApi.synonyms_flush ...'
1814
+ end
1815
+ # verify the required parameter 'app' is set
1816
+ if @api_client.config.client_side_validation && app.nil?
1817
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.synonyms_flush"
1818
+ end
1819
+ # verify the required parameter 'index' is set
1820
+ if @api_client.config.client_side_validation && index.nil?
1821
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.synonyms_flush"
1822
+ end
1823
+ # resource path
1824
+ local_var_path = '/indices/{app}/{index}/synonyms-flush'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1825
+
1826
+ # query parameters
1827
+ query_params = opts[:query_params] || {}
1828
+
1829
+ # header parameters
1830
+ header_params = opts[:header_params] || {}
1831
+ # HTTP header 'Accept' (if needed)
1832
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1833
+ # HTTP header 'Content-Type'
1834
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
1835
+
1836
+ # form parameters
1837
+ form_params = opts[:form_params] || {}
1838
+ form_params['password'] = opts[:'password'] if !opts[:'password'].nil?
1839
+
1840
+ # http body (model)
1841
+ post_body = opts[:body]
1842
+
1843
+ return_type = opts[:return_type] || 'Object'
1844
+
1845
+ auth_names = opts[:auth_names] || ['TokenAuth']
1846
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1847
+ :header_params => header_params,
1848
+ :query_params => query_params,
1849
+ :form_params => form_params,
1850
+ :body => post_body,
1851
+ :auth_names => auth_names,
1852
+ :return_type => return_type)
1853
+
1854
+ if @api_client.config.debugging
1855
+ @api_client.config.logger.debug "API called: IndicesApi#synonyms_flush\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1856
+ end
1857
+ return data, status_code, headers
1858
+ end
1859
+ # 导入同义词
1860
+ # @param body
1861
+ # @param action 覆盖方式
1862
+ # @param app 应用标识
1863
+ # @param index 索引编号
1864
+ # @param [Hash] opts the optional parameters
1865
+ # @return [Array<SynonymsBean>]
1866
+ def synonyms_import(body, action, app, index, opts = {})
1867
+ data, _status_code, _headers = synonyms_import_with_http_info(body, action, app, index, opts)
1868
+ data
1869
+ end
1870
+
1871
+ # 导入同义词
1872
+ # @param body
1873
+ # @param action 覆盖方式
1874
+ # @param app 应用标识
1875
+ # @param index 索引编号
1876
+ # @param [Hash] opts the optional parameters
1877
+ # @return [Array<(Array<SynonymsBean>, Integer, Hash)>] Array<SynonymsBean> data, response status code and response headers
1878
+ def synonyms_import_with_http_info(body, action, app, index, opts = {})
1879
+ if @api_client.config.debugging
1880
+ @api_client.config.logger.debug 'Calling API: IndicesApi.synonyms_import ...'
1881
+ end
1882
+ # verify the required parameter 'body' is set
1883
+ if @api_client.config.client_side_validation && body.nil?
1884
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.synonyms_import"
1885
+ end
1886
+ # verify the required parameter 'action' is set
1887
+ if @api_client.config.client_side_validation && action.nil?
1888
+ fail ArgumentError, "Missing the required parameter 'action' when calling IndicesApi.synonyms_import"
1889
+ end
1890
+ # verify the required parameter 'app' is set
1891
+ if @api_client.config.client_side_validation && app.nil?
1892
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.synonyms_import"
1893
+ end
1894
+ # verify the required parameter 'index' is set
1895
+ if @api_client.config.client_side_validation && index.nil?
1896
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.synonyms_import"
1897
+ end
1898
+ # resource path
1899
+ local_var_path = '/indices/{app}/{index}/synonyms-import'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1900
+
1901
+ # query parameters
1902
+ query_params = opts[:query_params] || {}
1903
+ query_params[:'action'] = action
1904
+
1905
+ # header parameters
1906
+ header_params = opts[:header_params] || {}
1907
+ # HTTP header 'Accept' (if needed)
1908
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1909
+ # HTTP header 'Content-Type'
1910
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1911
+
1912
+ # form parameters
1913
+ form_params = opts[:form_params] || {}
1914
+
1915
+ # http body (model)
1916
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
1917
+
1918
+ return_type = opts[:return_type] || 'Array<SynonymsBean>'
1919
+
1920
+ auth_names = opts[:auth_names] || ['TokenAuth']
1921
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1922
+ :header_params => header_params,
1923
+ :query_params => query_params,
1924
+ :form_params => form_params,
1925
+ :body => post_body,
1926
+ :auth_names => auth_names,
1927
+ :return_type => return_type)
1928
+
1929
+ if @api_client.config.debugging
1930
+ @api_client.config.logger.debug "API called: IndicesApi#synonyms_import\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1931
+ end
1932
+ return data, status_code, headers
1933
+ end
1934
+ # 获取索引的所有同义词
1935
+ # @param app 应用标识
1936
+ # @param index 索引编号
1937
+ # @param size
1938
+ # @param [Hash] opts the optional parameters
1939
+ # @option opts [Integer] :type 类型 (default to 0)
1940
+ # @option opts [Integer] :from (default to 0)
1941
+ # @return [Array<SynonymsBean>]
1942
+ def synonyms_list(app, index, size, opts = {})
1943
+ data, _status_code, _headers = synonyms_list_with_http_info(app, index, size, opts)
1944
+ data
1945
+ end
1946
+
1947
+ # 获取索引的所有同义词
1948
+ # @param app 应用标识
1949
+ # @param index 索引编号
1950
+ # @param size
1951
+ # @param [Hash] opts the optional parameters
1952
+ # @option opts [Integer] :type 类型
1953
+ # @option opts [Integer] :from
1954
+ # @return [Array<(Array<SynonymsBean>, Integer, Hash)>] Array<SynonymsBean> data, response status code and response headers
1955
+ def synonyms_list_with_http_info(app, index, size, opts = {})
1956
+ if @api_client.config.debugging
1957
+ @api_client.config.logger.debug 'Calling API: IndicesApi.synonyms_list ...'
1958
+ end
1959
+ # verify the required parameter 'app' is set
1960
+ if @api_client.config.client_side_validation && app.nil?
1961
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.synonyms_list"
1962
+ end
1963
+ # verify the required parameter 'index' is set
1964
+ if @api_client.config.client_side_validation && index.nil?
1965
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.synonyms_list"
1966
+ end
1967
+ # verify the required parameter 'size' is set
1968
+ if @api_client.config.client_side_validation && size.nil?
1969
+ fail ArgumentError, "Missing the required parameter 'size' when calling IndicesApi.synonyms_list"
1970
+ end
1971
+ # resource path
1972
+ local_var_path = '/indices/{app}/{index}/synonyms'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
1973
+
1974
+ # query parameters
1975
+ query_params = opts[:query_params] || {}
1976
+ query_params[:'size'] = size
1977
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
1978
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
1979
+
1980
+ # header parameters
1981
+ header_params = opts[:header_params] || {}
1982
+ # HTTP header 'Accept' (if needed)
1983
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1984
+
1985
+ # form parameters
1986
+ form_params = opts[:form_params] || {}
1987
+
1988
+ # http body (model)
1989
+ post_body = opts[:body]
1990
+
1991
+ return_type = opts[:return_type] || 'Array<SynonymsBean>'
1992
+
1993
+ auth_names = opts[:auth_names] || ['TokenAuth']
1994
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1995
+ :header_params => header_params,
1996
+ :query_params => query_params,
1997
+ :form_params => form_params,
1998
+ :body => post_body,
1999
+ :auth_names => auth_names,
2000
+ :return_type => return_type)
2001
+
2002
+ if @api_client.config.debugging
2003
+ @api_client.config.logger.debug "API called: IndicesApi#synonyms_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2004
+ end
2005
+ return data, status_code, headers
2006
+ end
2007
+ # 修改同义词
2008
+ # @param body
2009
+ # @param app 应用标识
2010
+ # @param index 索引编号
2011
+ # @param [Hash] opts the optional parameters
2012
+ # @return [SynonymsBean]
2013
+ def synonyms_update(body, app, index, opts = {})
2014
+ data, _status_code, _headers = synonyms_update_with_http_info(body, app, index, opts)
2015
+ data
2016
+ end
2017
+
2018
+ # 修改同义词
2019
+ # @param body
2020
+ # @param app 应用标识
2021
+ # @param index 索引编号
2022
+ # @param [Hash] opts the optional parameters
2023
+ # @return [Array<(SynonymsBean, Integer, Hash)>] SynonymsBean data, response status code and response headers
2024
+ def synonyms_update_with_http_info(body, app, index, opts = {})
2025
+ if @api_client.config.debugging
2026
+ @api_client.config.logger.debug 'Calling API: IndicesApi.synonyms_update ...'
2027
+ end
2028
+ # verify the required parameter 'body' is set
2029
+ if @api_client.config.client_side_validation && body.nil?
2030
+ fail ArgumentError, "Missing the required parameter 'body' when calling IndicesApi.synonyms_update"
2031
+ end
2032
+ # verify the required parameter 'app' is set
2033
+ if @api_client.config.client_side_validation && app.nil?
2034
+ fail ArgumentError, "Missing the required parameter 'app' when calling IndicesApi.synonyms_update"
2035
+ end
2036
+ # verify the required parameter 'index' is set
2037
+ if @api_client.config.client_side_validation && index.nil?
2038
+ fail ArgumentError, "Missing the required parameter 'index' when calling IndicesApi.synonyms_update"
2039
+ end
2040
+ # resource path
2041
+ local_var_path = '/indices/{app}/{index}/synonyms'.sub('{' + 'app' + '}', app.to_s).sub('{' + 'index' + '}', index.to_s)
2042
+
2043
+ # query parameters
2044
+ query_params = opts[:query_params] || {}
2045
+
2046
+ # header parameters
2047
+ header_params = opts[:header_params] || {}
2048
+ # HTTP header 'Accept' (if needed)
2049
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2050
+ # HTTP header 'Content-Type'
2051
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2052
+
2053
+ # form parameters
2054
+ form_params = opts[:form_params] || {}
2055
+
2056
+ # http body (model)
2057
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
2058
+
2059
+ return_type = opts[:return_type] || 'SynonymsBean'
2060
+
2061
+ auth_names = opts[:auth_names] || ['TokenAuth']
2062
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
2063
+ :header_params => header_params,
2064
+ :query_params => query_params,
2065
+ :form_params => form_params,
2066
+ :body => post_body,
2067
+ :auth_names => auth_names,
2068
+ :return_type => return_type)
2069
+
2070
+ if @api_client.config.debugging
2071
+ @api_client.config.logger.debug "API called: IndicesApi#synonyms_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2072
+ end
2073
+ return data, status_code, headers
2074
+ end
2075
+ end
2076
+ end