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,892 @@
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 SearchApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # 搜索结果点击行为收集
20
+ # 该接口主要用于记录用户对搜索结果的点击行为
21
+ # @param widget 组件唯一标识
22
+ # @param action_id 对应搜索行为编号
23
+ # @param doc_id 对应索引中的内部记录编号
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
26
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
27
+ # @return [BOOLEAN]
28
+ def search_click(widget, action_id, doc_id, opts = {})
29
+ data, _status_code, _headers = search_click_with_http_info(widget, action_id, doc_id, opts)
30
+ data
31
+ end
32
+
33
+ # 搜索结果点击行为收集
34
+ # 该接口主要用于记录用户对搜索结果的点击行为
35
+ # @param widget 组件唯一标识
36
+ # @param action_id 对应搜索行为编号
37
+ # @param doc_id 对应索引中的内部记录编号
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
40
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
41
+ # @return [Array<(BOOLEAN, Integer, Hash)>] BOOLEAN data, response status code and response headers
42
+ def search_click_with_http_info(widget, action_id, doc_id, opts = {})
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_click ...'
45
+ end
46
+ # verify the required parameter 'widget' is set
47
+ if @api_client.config.client_side_validation && widget.nil?
48
+ fail ArgumentError, "Missing the required parameter 'widget' when calling SearchApi.search_click"
49
+ end
50
+ # verify the required parameter 'action_id' is set
51
+ if @api_client.config.client_side_validation && action_id.nil?
52
+ fail ArgumentError, "Missing the required parameter 'action_id' when calling SearchApi.search_click"
53
+ end
54
+ # verify the required parameter 'doc_id' is set
55
+ if @api_client.config.client_side_validation && doc_id.nil?
56
+ fail ArgumentError, "Missing the required parameter 'doc_id' when calling SearchApi.search_click"
57
+ end
58
+ # resource path
59
+ local_var_path = '/search/widget/{widget}/click'.sub('{' + 'widget' + '}', widget.to_s)
60
+
61
+ # query parameters
62
+ query_params = opts[:query_params] || {}
63
+ query_params[:'action_id'] = action_id
64
+ query_params[:'doc_id'] = doc_id
65
+
66
+ # header parameters
67
+ header_params = opts[:header_params] || {}
68
+ # HTTP header 'Accept' (if needed)
69
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
70
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
71
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
72
+
73
+ # form parameters
74
+ form_params = opts[:form_params] || {}
75
+
76
+ # http body (model)
77
+ post_body = opts[:body]
78
+
79
+ return_type = opts[:return_type] || 'BOOLEAN'
80
+
81
+ auth_names = opts[:auth_names] || []
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
83
+ :header_params => header_params,
84
+ :query_params => query_params,
85
+ :form_params => form_params,
86
+ :body => post_body,
87
+ :auth_names => auth_names,
88
+ :return_type => return_type)
89
+
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: SearchApi#search_click\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+ # 获取当前搜索用户的最新搜索记录
96
+ # @param widget 组件唯一标识
97
+ # @param strategy 搜索记录策略
98
+ # @param query 指定关联查询的编号
99
+ # @param size 数量
100
+ # @param [Hash] opts the optional parameters
101
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
102
+ # @option opts [String] :x_token 如果要使用非公开的组件,需要组件作者授权
103
+ # @return [Array<String>]
104
+ def search_histories(widget, strategy, query, size, opts = {})
105
+ data, _status_code, _headers = search_histories_with_http_info(widget, strategy, query, size, opts)
106
+ data
107
+ end
108
+
109
+ # 获取当前搜索用户的最新搜索记录
110
+ # @param widget 组件唯一标识
111
+ # @param strategy 搜索记录策略
112
+ # @param query 指定关联查询的编号
113
+ # @param size 数量
114
+ # @param [Hash] opts the optional parameters
115
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
116
+ # @option opts [String] :x_token 如果要使用非公开的组件,需要组件作者授权
117
+ # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
118
+ def search_histories_with_http_info(widget, strategy, query, size, opts = {})
119
+ if @api_client.config.debugging
120
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_histories ...'
121
+ end
122
+ # verify the required parameter 'widget' is set
123
+ if @api_client.config.client_side_validation && widget.nil?
124
+ fail ArgumentError, "Missing the required parameter 'widget' when calling SearchApi.search_histories"
125
+ end
126
+ # verify the required parameter 'strategy' is set
127
+ if @api_client.config.client_side_validation && strategy.nil?
128
+ fail ArgumentError, "Missing the required parameter 'strategy' when calling SearchApi.search_histories"
129
+ end
130
+ # verify enum value
131
+ if @api_client.config.client_side_validation && !['recent', 'popular'].include?(strategy)
132
+ fail ArgumentError, "invalid value for 'strategy', must be one of recent, popular"
133
+ end
134
+ # verify the required parameter 'query' is set
135
+ if @api_client.config.client_side_validation && query.nil?
136
+ fail ArgumentError, "Missing the required parameter 'query' when calling SearchApi.search_histories"
137
+ end
138
+ # verify the required parameter 'size' is set
139
+ if @api_client.config.client_side_validation && size.nil?
140
+ fail ArgumentError, "Missing the required parameter 'size' when calling SearchApi.search_histories"
141
+ end
142
+ # resource path
143
+ local_var_path = '/search/widget/{widget}/histories'.sub('{' + 'widget' + '}', widget.to_s)
144
+
145
+ # query parameters
146
+ query_params = opts[:query_params] || {}
147
+ query_params[:'strategy'] = strategy
148
+ query_params[:'query'] = query
149
+ query_params[:'size'] = size
150
+
151
+ # header parameters
152
+ header_params = opts[:header_params] || {}
153
+ # HTTP header 'Accept' (if needed)
154
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
155
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
156
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
157
+
158
+ # form parameters
159
+ form_params = opts[:form_params] || {}
160
+
161
+ # http body (model)
162
+ post_body = opts[:body]
163
+
164
+ return_type = opts[:return_type] || 'Array<String>'
165
+
166
+ auth_names = opts[:auth_names] || []
167
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
168
+ :header_params => header_params,
169
+ :query_params => query_params,
170
+ :form_params => form_params,
171
+ :body => post_body,
172
+ :auth_names => auth_names,
173
+ :return_type => return_type)
174
+
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug "API called: SearchApi#search_histories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
177
+ end
178
+ return data, status_code, headers
179
+ end
180
+ # 获取搜索日志
181
+ # 该接口主要用于获取搜索明细
182
+ # @param app 应用标识
183
+ # @param [Hash] opts the optional parameters
184
+ # @option opts [Array<Integer>] :indices 只看指定索引
185
+ # @option opts [String] :scope 搜索范围 (default to all)
186
+ # @option opts [Integer] :widget 搜索组件 (default to 0)
187
+ # @option opts [Integer] :query 指定查询 (default to 0)
188
+ # @option opts [Integer] :recomm 推荐组件 (default to 0)
189
+ # @option opts [Date] :start_date 统计起始日期
190
+ # @option opts [Date] :end_date 统计结束日期
191
+ # @option opts [Integer] :from 起始位置 (default to 0)
192
+ # @option opts [Integer] :size 每页记录数量 (default to 50)
193
+ # @return [Array<QueryActionBean>]
194
+ def search_logs(app, opts = {})
195
+ data, _status_code, _headers = search_logs_with_http_info(app, opts)
196
+ data
197
+ end
198
+
199
+ # 获取搜索日志
200
+ # 该接口主要用于获取搜索明细
201
+ # @param app 应用标识
202
+ # @param [Hash] opts the optional parameters
203
+ # @option opts [Array<Integer>] :indices 只看指定索引
204
+ # @option opts [String] :scope 搜索范围
205
+ # @option opts [Integer] :widget 搜索组件
206
+ # @option opts [Integer] :query 指定查询
207
+ # @option opts [Integer] :recomm 推荐组件
208
+ # @option opts [Date] :start_date 统计起始日期
209
+ # @option opts [Date] :end_date 统计结束日期
210
+ # @option opts [Integer] :from 起始位置
211
+ # @option opts [Integer] :size 每页记录数量
212
+ # @return [Array<(Array<QueryActionBean>, Integer, Hash)>] Array<QueryActionBean> data, response status code and response headers
213
+ def search_logs_with_http_info(app, opts = {})
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_logs ...'
216
+ end
217
+ # verify the required parameter 'app' is set
218
+ if @api_client.config.client_side_validation && app.nil?
219
+ fail ArgumentError, "Missing the required parameter 'app' when calling SearchApi.search_logs"
220
+ end
221
+ if @api_client.config.client_side_validation && opts[:'scope'] && !['all', 'search', 'recomm'].include?(opts[:'scope'])
222
+ fail ArgumentError, 'invalid value for "scope", must be one of all, search, recomm'
223
+ end
224
+ # resource path
225
+ local_var_path = '/apps/{app}/logs-searchs'.sub('{' + 'app' + '}', app.to_s)
226
+
227
+ # query parameters
228
+ query_params = opts[:query_params] || {}
229
+ query_params[:'indices'] = @api_client.build_collection_param(opts[:'indices'], :multi) if !opts[:'indices'].nil?
230
+ query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
231
+ query_params[:'widget'] = opts[:'widget'] if !opts[:'widget'].nil?
232
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
233
+ query_params[:'recomm'] = opts[:'recomm'] if !opts[:'recomm'].nil?
234
+ query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
235
+ query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
236
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
237
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
238
+
239
+ # header parameters
240
+ header_params = opts[:header_params] || {}
241
+ # HTTP header 'Accept' (if needed)
242
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
243
+
244
+ # form parameters
245
+ form_params = opts[:form_params] || {}
246
+
247
+ # http body (model)
248
+ post_body = opts[:body]
249
+
250
+ return_type = opts[:return_type] || 'Array<QueryActionBean>'
251
+
252
+ auth_names = opts[:auth_names] || ['TokenAuth']
253
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
254
+ :header_params => header_params,
255
+ :query_params => query_params,
256
+ :form_params => form_params,
257
+ :body => post_body,
258
+ :auth_names => auth_names,
259
+ :return_type => return_type)
260
+
261
+ if @api_client.config.debugging
262
+ @api_client.config.logger.debug "API called: SearchApi#search_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
263
+ end
264
+ return data, status_code, headers
265
+ end
266
+ # 获取当前搜索用户的最新搜索记录
267
+ # @param query 查询唯一标识
268
+ # @param strategy 搜索记录策略
269
+ # @param size 数量
270
+ # @param [Hash] opts the optional parameters
271
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
272
+ # @option opts [String] :x_token 如果要使用非公开查询,需要组件作者授权
273
+ # @return [Array<String>]
274
+ def search_query_histories(query, strategy, size, opts = {})
275
+ data, _status_code, _headers = search_query_histories_with_http_info(query, strategy, size, opts)
276
+ data
277
+ end
278
+
279
+ # 获取当前搜索用户的最新搜索记录
280
+ # @param query 查询唯一标识
281
+ # @param strategy 搜索记录策略
282
+ # @param size 数量
283
+ # @param [Hash] opts the optional parameters
284
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
285
+ # @option opts [String] :x_token 如果要使用非公开查询,需要组件作者授权
286
+ # @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
287
+ def search_query_histories_with_http_info(query, strategy, size, opts = {})
288
+ if @api_client.config.debugging
289
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_query_histories ...'
290
+ end
291
+ # verify the required parameter 'query' is set
292
+ if @api_client.config.client_side_validation && query.nil?
293
+ fail ArgumentError, "Missing the required parameter 'query' when calling SearchApi.search_query_histories"
294
+ end
295
+ # verify the required parameter 'strategy' is set
296
+ if @api_client.config.client_side_validation && strategy.nil?
297
+ fail ArgumentError, "Missing the required parameter 'strategy' when calling SearchApi.search_query_histories"
298
+ end
299
+ # verify enum value
300
+ if @api_client.config.client_side_validation && !['recent', 'popular'].include?(strategy)
301
+ fail ArgumentError, "invalid value for 'strategy', must be one of recent, popular"
302
+ end
303
+ # verify the required parameter 'size' is set
304
+ if @api_client.config.client_side_validation && size.nil?
305
+ fail ArgumentError, "Missing the required parameter 'size' when calling SearchApi.search_query_histories"
306
+ end
307
+ # resource path
308
+ local_var_path = '/search/query/{query}/histories'.sub('{' + 'query' + '}', query.to_s)
309
+
310
+ # query parameters
311
+ query_params = opts[:query_params] || {}
312
+ query_params[:'strategy'] = strategy
313
+ query_params[:'size'] = size
314
+
315
+ # header parameters
316
+ header_params = opts[:header_params] || {}
317
+ # HTTP header 'Accept' (if needed)
318
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
319
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
320
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
321
+
322
+ # form parameters
323
+ form_params = opts[:form_params] || {}
324
+
325
+ # http body (model)
326
+ post_body = opts[:body]
327
+
328
+ return_type = opts[:return_type] || 'Array<String>'
329
+
330
+ auth_names = opts[:auth_names] || []
331
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
332
+ :header_params => header_params,
333
+ :query_params => query_params,
334
+ :form_params => form_params,
335
+ :body => post_body,
336
+ :auth_names => auth_names,
337
+ :return_type => return_type)
338
+
339
+ if @api_client.config.debugging
340
+ @api_client.config.logger.debug "API called: SearchApi#search_query_histories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
341
+ end
342
+ return data, status_code, headers
343
+ end
344
+ # 获取查询相关热词
345
+ # @param query 查询标识
346
+ # @param scope 时间范围
347
+ # @param count 获取热词数量
348
+ # @param [Hash] opts the optional parameters
349
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
350
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
351
+ # @return [Array<SearchWord>]
352
+ def search_query_hot_words(query, scope, count, opts = {})
353
+ data, _status_code, _headers = search_query_hot_words_with_http_info(query, scope, count, opts)
354
+ data
355
+ end
356
+
357
+ # 获取查询相关热词
358
+ # @param query 查询标识
359
+ # @param scope 时间范围
360
+ # @param count 获取热词数量
361
+ # @param [Hash] opts the optional parameters
362
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
363
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
364
+ # @return [Array<(Array<SearchWord>, Integer, Hash)>] Array<SearchWord> data, response status code and response headers
365
+ def search_query_hot_words_with_http_info(query, scope, count, opts = {})
366
+ if @api_client.config.debugging
367
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_query_hot_words ...'
368
+ end
369
+ # verify the required parameter 'query' is set
370
+ if @api_client.config.client_side_validation && query.nil?
371
+ fail ArgumentError, "Missing the required parameter 'query' when calling SearchApi.search_query_hot_words"
372
+ end
373
+ # verify the required parameter 'scope' is set
374
+ if @api_client.config.client_side_validation && scope.nil?
375
+ fail ArgumentError, "Missing the required parameter 'scope' when calling SearchApi.search_query_hot_words"
376
+ end
377
+ # verify enum value
378
+ if @api_client.config.client_side_validation && !['month', 'year', 'all'].include?(scope)
379
+ fail ArgumentError, "invalid value for 'scope', must be one of month, year, all"
380
+ end
381
+ # verify the required parameter 'count' is set
382
+ if @api_client.config.client_side_validation && count.nil?
383
+ fail ArgumentError, "Missing the required parameter 'count' when calling SearchApi.search_query_hot_words"
384
+ end
385
+ # resource path
386
+ local_var_path = '/search/query/{query}/hotwords'.sub('{' + 'query' + '}', query.to_s)
387
+
388
+ # query parameters
389
+ query_params = opts[:query_params] || {}
390
+ query_params[:'scope'] = scope
391
+ query_params[:'count'] = count
392
+
393
+ # header parameters
394
+ header_params = opts[:header_params] || {}
395
+ # HTTP header 'Accept' (if needed)
396
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
397
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
398
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
399
+
400
+ # form parameters
401
+ form_params = opts[:form_params] || {}
402
+
403
+ # http body (model)
404
+ post_body = opts[:body]
405
+
406
+ return_type = opts[:return_type] || 'Array<SearchWord>'
407
+
408
+ auth_names = opts[:auth_names] || []
409
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
410
+ :header_params => header_params,
411
+ :query_params => query_params,
412
+ :form_params => form_params,
413
+ :body => post_body,
414
+ :auth_names => auth_names,
415
+ :return_type => return_type)
416
+
417
+ if @api_client.config.debugging
418
+ @api_client.config.logger.debug "API called: SearchApi#search_query_hot_words\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
419
+ end
420
+ return data, status_code, headers
421
+ end
422
+ # 读取滚动搜索结果
423
+ # 先调用 search.queryScroll 获取 scroll_id 值以及第一批结果记录,然后使用 scroll_id 值调用该接口获取下一批结果记录,请注意该值的有效期是 1 分钟
424
+ # @param query 查询标识
425
+ # @param id scroll_id 值,该值的有效期是 1 分钟
426
+ # @param [Hash] opts the optional parameters
427
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
428
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
429
+ # @return [Object]
430
+ def search_query_repeat_scroll(query, id, opts = {})
431
+ data, _status_code, _headers = search_query_repeat_scroll_with_http_info(query, id, opts)
432
+ data
433
+ end
434
+
435
+ # 读取滚动搜索结果
436
+ # 先调用 search.queryScroll 获取 scroll_id 值以及第一批结果记录,然后使用 scroll_id 值调用该接口获取下一批结果记录,请注意该值的有效期是 1 分钟
437
+ # @param query 查询标识
438
+ # @param id scroll_id 值,该值的有效期是 1 分钟
439
+ # @param [Hash] opts the optional parameters
440
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
441
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
442
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
443
+ def search_query_repeat_scroll_with_http_info(query, id, opts = {})
444
+ if @api_client.config.debugging
445
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_query_repeat_scroll ...'
446
+ end
447
+ # verify the required parameter 'query' is set
448
+ if @api_client.config.client_side_validation && query.nil?
449
+ fail ArgumentError, "Missing the required parameter 'query' when calling SearchApi.search_query_repeat_scroll"
450
+ end
451
+ # verify the required parameter 'id' is set
452
+ if @api_client.config.client_side_validation && id.nil?
453
+ fail ArgumentError, "Missing the required parameter 'id' when calling SearchApi.search_query_repeat_scroll"
454
+ end
455
+ # resource path
456
+ local_var_path = '/search/scroll/{query}'.sub('{' + 'query' + '}', query.to_s)
457
+
458
+ # query parameters
459
+ query_params = opts[:query_params] || {}
460
+ query_params[:'id'] = id
461
+
462
+ # header parameters
463
+ header_params = opts[:header_params] || {}
464
+ # HTTP header 'Accept' (if needed)
465
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
466
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
467
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
468
+
469
+ # form parameters
470
+ form_params = opts[:form_params] || {}
471
+
472
+ # http body (model)
473
+ post_body = opts[:body]
474
+
475
+ return_type = opts[:return_type] || 'Object'
476
+
477
+ auth_names = opts[:auth_names] || []
478
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
479
+ :header_params => header_params,
480
+ :query_params => query_params,
481
+ :form_params => form_params,
482
+ :body => post_body,
483
+ :auth_names => auth_names,
484
+ :return_type => return_type)
485
+
486
+ if @api_client.config.debugging
487
+ @api_client.config.logger.debug "API called: SearchApi#search_query_repeat_scroll\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
488
+ end
489
+ return data, status_code, headers
490
+ end
491
+ # 基于查询的滚动搜索
492
+ # 用于读取超过 10000 条记录的搜索结果,当需要读取大批量查询结果时请采用此接口获得 scroll_id 值,然后再用 POST 方法 queryRepeatScroll 读取剩余的其他结果,每批次的读取间隔不能超过 1 分钟
493
+ # @param query 查询标识
494
+ # @param [Hash] opts the optional parameters
495
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
496
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
497
+ # @option opts [Integer] :size 单次滚动的记录数 (default to 100)
498
+ # @option opts [String] :q 搜索关键字
499
+ # @option opts [Hash<String, String>] :params 聚合参数
500
+ # @return [Object]
501
+ def search_query_scroll(query, opts = {})
502
+ data, _status_code, _headers = search_query_scroll_with_http_info(query, opts)
503
+ data
504
+ end
505
+
506
+ # 基于查询的滚动搜索
507
+ # 用于读取超过 10000 条记录的搜索结果,当需要读取大批量查询结果时请采用此接口获得 scroll_id 值,然后再用 POST 方法 queryRepeatScroll 读取剩余的其他结果,每批次的读取间隔不能超过 1 分钟
508
+ # @param query 查询标识
509
+ # @param [Hash] opts the optional parameters
510
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
511
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
512
+ # @option opts [Integer] :size 单次滚动的记录数
513
+ # @option opts [String] :q 搜索关键字
514
+ # @option opts [Hash<String, String>] :params 聚合参数
515
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
516
+ def search_query_scroll_with_http_info(query, opts = {})
517
+ if @api_client.config.debugging
518
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_query_scroll ...'
519
+ end
520
+ # verify the required parameter 'query' is set
521
+ if @api_client.config.client_side_validation && query.nil?
522
+ fail ArgumentError, "Missing the required parameter 'query' when calling SearchApi.search_query_scroll"
523
+ end
524
+ # resource path
525
+ local_var_path = '/search/scroll/{query}'.sub('{' + 'query' + '}', query.to_s)
526
+
527
+ # query parameters
528
+ query_params = opts[:query_params] || {}
529
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
530
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
531
+ query_params[:'params'] = @api_client.build_collection_param(opts[:'params'], :multi) if !opts[:'params'].nil?
532
+
533
+ # header parameters
534
+ header_params = opts[:header_params] || {}
535
+ # HTTP header 'Accept' (if needed)
536
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
537
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
538
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
539
+
540
+ # form parameters
541
+ form_params = opts[:form_params] || {}
542
+
543
+ # http body (model)
544
+ post_body = opts[:body]
545
+
546
+ return_type = opts[:return_type] || 'Object'
547
+
548
+ auth_names = opts[:auth_names] || []
549
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
550
+ :header_params => header_params,
551
+ :query_params => query_params,
552
+ :form_params => form_params,
553
+ :body => post_body,
554
+ :auth_names => auth_names,
555
+ :return_type => return_type)
556
+
557
+ if @api_client.config.debugging
558
+ @api_client.config.logger.debug "API called: SearchApi#search_query_scroll\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
559
+ end
560
+ return data, status_code, headers
561
+ end
562
+ # 基于查询的公开搜索
563
+ # 该接口主要用于公开搜索,如果查询是公开的就不需要授权
564
+ # @param query 查询标识
565
+ # @param from 起始记录
566
+ # @param size 每页记录数量
567
+ # @param [Hash] opts the optional parameters
568
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
569
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
570
+ # @option opts [String] :q 搜索关键字
571
+ # @option opts [Hash<String, String>] :params 聚合参数
572
+ # @return [Object]
573
+ def search_query_search(query, from, size, opts = {})
574
+ data, _status_code, _headers = search_query_search_with_http_info(query, from, size, opts)
575
+ data
576
+ end
577
+
578
+ # 基于查询的公开搜索
579
+ # 该接口主要用于公开搜索,如果查询是公开的就不需要授权
580
+ # @param query 查询标识
581
+ # @param from 起始记录
582
+ # @param size 每页记录数量
583
+ # @param [Hash] opts the optional parameters
584
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
585
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
586
+ # @option opts [String] :q 搜索关键字
587
+ # @option opts [Hash<String, String>] :params 聚合参数
588
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
589
+ def search_query_search_with_http_info(query, from, size, opts = {})
590
+ if @api_client.config.debugging
591
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_query_search ...'
592
+ end
593
+ # verify the required parameter 'query' is set
594
+ if @api_client.config.client_side_validation && query.nil?
595
+ fail ArgumentError, "Missing the required parameter 'query' when calling SearchApi.search_query_search"
596
+ end
597
+ # verify the required parameter 'from' is set
598
+ if @api_client.config.client_side_validation && from.nil?
599
+ fail ArgumentError, "Missing the required parameter 'from' when calling SearchApi.search_query_search"
600
+ end
601
+ # verify the required parameter 'size' is set
602
+ if @api_client.config.client_side_validation && size.nil?
603
+ fail ArgumentError, "Missing the required parameter 'size' when calling SearchApi.search_query_search"
604
+ end
605
+ # resource path
606
+ local_var_path = '/search/query/{query}'.sub('{' + 'query' + '}', query.to_s)
607
+
608
+ # query parameters
609
+ query_params = opts[:query_params] || {}
610
+ query_params[:'from'] = from
611
+ query_params[:'size'] = size
612
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
613
+ query_params[:'params'] = @api_client.build_collection_param(opts[:'params'], :multi) if !opts[:'params'].nil?
614
+
615
+ # header parameters
616
+ header_params = opts[:header_params] || {}
617
+ # HTTP header 'Accept' (if needed)
618
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
619
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
620
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
621
+
622
+ # form parameters
623
+ form_params = opts[:form_params] || {}
624
+
625
+ # http body (model)
626
+ post_body = opts[:body]
627
+
628
+ return_type = opts[:return_type] || 'Object'
629
+
630
+ auth_names = opts[:auth_names] || []
631
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
632
+ :header_params => header_params,
633
+ :query_params => query_params,
634
+ :form_params => form_params,
635
+ :body => post_body,
636
+ :auth_names => auth_names,
637
+ :return_type => return_type)
638
+
639
+ if @api_client.config.debugging
640
+ @api_client.config.logger.debug "API called: SearchApi#search_query_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
641
+ end
642
+ return data, status_code, headers
643
+ end
644
+ # 基于组件的搜索词自动完成
645
+ # 该接口主要为搜索输入框提供自动完成的功能
646
+ # @param widget 组件唯一标识
647
+ # @param query 查询编号
648
+ # @param q 搜索关键字
649
+ # @param size 数量
650
+ # @param [Hash] opts the optional parameters
651
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
652
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
653
+ # @return [Array<AutoCompleteItem>]
654
+ def search_widget_auto_complete(widget, query, q, size, opts = {})
655
+ data, _status_code, _headers = search_widget_auto_complete_with_http_info(widget, query, q, size, opts)
656
+ data
657
+ end
658
+
659
+ # 基于组件的搜索词自动完成
660
+ # 该接口主要为搜索输入框提供自动完成的功能
661
+ # @param widget 组件唯一标识
662
+ # @param query 查询编号
663
+ # @param q 搜索关键字
664
+ # @param size 数量
665
+ # @param [Hash] opts the optional parameters
666
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
667
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
668
+ # @return [Array<(Array<AutoCompleteItem>, Integer, Hash)>] Array<AutoCompleteItem> data, response status code and response headers
669
+ def search_widget_auto_complete_with_http_info(widget, query, q, size, opts = {})
670
+ if @api_client.config.debugging
671
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_widget_auto_complete ...'
672
+ end
673
+ # verify the required parameter 'widget' is set
674
+ if @api_client.config.client_side_validation && widget.nil?
675
+ fail ArgumentError, "Missing the required parameter 'widget' when calling SearchApi.search_widget_auto_complete"
676
+ end
677
+ # verify the required parameter 'query' is set
678
+ if @api_client.config.client_side_validation && query.nil?
679
+ fail ArgumentError, "Missing the required parameter 'query' when calling SearchApi.search_widget_auto_complete"
680
+ end
681
+ # verify the required parameter 'q' is set
682
+ if @api_client.config.client_side_validation && q.nil?
683
+ fail ArgumentError, "Missing the required parameter 'q' when calling SearchApi.search_widget_auto_complete"
684
+ end
685
+ # verify the required parameter 'size' is set
686
+ if @api_client.config.client_side_validation && size.nil?
687
+ fail ArgumentError, "Missing the required parameter 'size' when calling SearchApi.search_widget_auto_complete"
688
+ end
689
+ # resource path
690
+ local_var_path = '/search/widget/{widget}/autocomplete'.sub('{' + 'widget' + '}', widget.to_s)
691
+
692
+ # query parameters
693
+ query_params = opts[:query_params] || {}
694
+ query_params[:'query'] = query
695
+ query_params[:'q'] = q
696
+ query_params[:'size'] = size
697
+
698
+ # header parameters
699
+ header_params = opts[:header_params] || {}
700
+ # HTTP header 'Accept' (if needed)
701
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
702
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
703
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
704
+
705
+ # form parameters
706
+ form_params = opts[:form_params] || {}
707
+
708
+ # http body (model)
709
+ post_body = opts[:body]
710
+
711
+ return_type = opts[:return_type] || 'Array<AutoCompleteItem>'
712
+
713
+ auth_names = opts[:auth_names] || []
714
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
715
+ :header_params => header_params,
716
+ :query_params => query_params,
717
+ :form_params => form_params,
718
+ :body => post_body,
719
+ :auth_names => auth_names,
720
+ :return_type => return_type)
721
+
722
+ if @api_client.config.debugging
723
+ @api_client.config.logger.debug "API called: SearchApi#search_widget_auto_complete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
724
+ end
725
+ return data, status_code, headers
726
+ end
727
+ # 获取组件搜索的相关热词
728
+ # @param widget 组件唯一标识
729
+ # @param [Hash] opts the optional parameters
730
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
731
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
732
+ # @option opts [Integer] :query 查询编号
733
+ # @option opts [String] :scope 时间范围
734
+ # @option opts [Integer] :count 获取热词数量 (default to 10)
735
+ # @return [Array<SearchWord>]
736
+ def search_widget_hot_words(widget, opts = {})
737
+ data, _status_code, _headers = search_widget_hot_words_with_http_info(widget, opts)
738
+ data
739
+ end
740
+
741
+ # 获取组件搜索的相关热词
742
+ # @param widget 组件唯一标识
743
+ # @param [Hash] opts the optional parameters
744
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
745
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
746
+ # @option opts [Integer] :query 查询编号
747
+ # @option opts [String] :scope 时间范围
748
+ # @option opts [Integer] :count 获取热词数量
749
+ # @return [Array<(Array<SearchWord>, Integer, Hash)>] Array<SearchWord> data, response status code and response headers
750
+ def search_widget_hot_words_with_http_info(widget, opts = {})
751
+ if @api_client.config.debugging
752
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_widget_hot_words ...'
753
+ end
754
+ # verify the required parameter 'widget' is set
755
+ if @api_client.config.client_side_validation && widget.nil?
756
+ fail ArgumentError, "Missing the required parameter 'widget' when calling SearchApi.search_widget_hot_words"
757
+ end
758
+ if @api_client.config.client_side_validation && opts[:'scope'] && !['month', 'year', 'all', 'custom'].include?(opts[:'scope'])
759
+ fail ArgumentError, 'invalid value for "scope", must be one of month, year, all, custom'
760
+ end
761
+ # resource path
762
+ local_var_path = '/search/widget/{widget}/hotwords'.sub('{' + 'widget' + '}', widget.to_s)
763
+
764
+ # query parameters
765
+ query_params = opts[:query_params] || {}
766
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
767
+ query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
768
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
769
+
770
+ # header parameters
771
+ header_params = opts[:header_params] || {}
772
+ # HTTP header 'Accept' (if needed)
773
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
774
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
775
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
776
+
777
+ # form parameters
778
+ form_params = opts[:form_params] || {}
779
+
780
+ # http body (model)
781
+ post_body = opts[:body]
782
+
783
+ return_type = opts[:return_type] || 'Array<SearchWord>'
784
+
785
+ auth_names = opts[:auth_names] || []
786
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
787
+ :header_params => header_params,
788
+ :query_params => query_params,
789
+ :form_params => form_params,
790
+ :body => post_body,
791
+ :auth_names => auth_names,
792
+ :return_type => return_type)
793
+
794
+ if @api_client.config.debugging
795
+ @api_client.config.logger.debug "API called: SearchApi#search_widget_hot_words\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
796
+ end
797
+ return data, status_code, headers
798
+ end
799
+ # 基于组件的公开搜索
800
+ # 该接口主要为UI组件提供公开搜索
801
+ # @param widget 组件唯一标识
802
+ # @param query 查询编号
803
+ # @param from 起始记录
804
+ # @param size 每页记录数量, 如果值小于0则使用预设值的记录数
805
+ # @param [Hash] opts the optional parameters
806
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
807
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
808
+ # @option opts [String] :original 搜索动作的延续,在 Web 组件中一边输入即时搜索时,使用的是同一个 original,original 值等于第一个搜索动作产生结果中的 action 值
809
+ # @option opts [String] :q 搜索关键字
810
+ # @option opts [Hash<String, String>] :params 聚合参数
811
+ # @return [Object]
812
+ def search_widget_search(widget, query, from, size, opts = {})
813
+ data, _status_code, _headers = search_widget_search_with_http_info(widget, query, from, size, opts)
814
+ data
815
+ end
816
+
817
+ # 基于组件的公开搜索
818
+ # 该接口主要为UI组件提供公开搜索
819
+ # @param widget 组件唯一标识
820
+ # @param query 查询编号
821
+ # @param from 起始记录
822
+ # @param size 每页记录数量, 如果值小于0则使用预设值的记录数
823
+ # @param [Hash] opts the optional parameters
824
+ # @option opts [String] :userid 搜索者的唯一标识,该标识由搜索前端生成,长度不超过64
825
+ # @option opts [String] :x_token 如果要使用非发布的组件,需要组件作者授权
826
+ # @option opts [String] :original 搜索动作的延续,在 Web 组件中一边输入即时搜索时,使用的是同一个 original,original 值等于第一个搜索动作产生结果中的 action 值
827
+ # @option opts [String] :q 搜索关键字
828
+ # @option opts [Hash<String, String>] :params 聚合参数
829
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
830
+ def search_widget_search_with_http_info(widget, query, from, size, opts = {})
831
+ if @api_client.config.debugging
832
+ @api_client.config.logger.debug 'Calling API: SearchApi.search_widget_search ...'
833
+ end
834
+ # verify the required parameter 'widget' is set
835
+ if @api_client.config.client_side_validation && widget.nil?
836
+ fail ArgumentError, "Missing the required parameter 'widget' when calling SearchApi.search_widget_search"
837
+ end
838
+ # verify the required parameter 'query' is set
839
+ if @api_client.config.client_side_validation && query.nil?
840
+ fail ArgumentError, "Missing the required parameter 'query' when calling SearchApi.search_widget_search"
841
+ end
842
+ # verify the required parameter 'from' is set
843
+ if @api_client.config.client_side_validation && from.nil?
844
+ fail ArgumentError, "Missing the required parameter 'from' when calling SearchApi.search_widget_search"
845
+ end
846
+ # verify the required parameter 'size' is set
847
+ if @api_client.config.client_side_validation && size.nil?
848
+ fail ArgumentError, "Missing the required parameter 'size' when calling SearchApi.search_widget_search"
849
+ end
850
+ # resource path
851
+ local_var_path = '/search/widget/{widget}'.sub('{' + 'widget' + '}', widget.to_s)
852
+
853
+ # query parameters
854
+ query_params = opts[:query_params] || {}
855
+ query_params[:'query'] = query
856
+ query_params[:'from'] = from
857
+ query_params[:'size'] = size
858
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
859
+ query_params[:'params'] = @api_client.build_collection_param(opts[:'params'], :multi) if !opts[:'params'].nil?
860
+
861
+ # header parameters
862
+ header_params = opts[:header_params] || {}
863
+ # HTTP header 'Accept' (if needed)
864
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
865
+ header_params[:'userid'] = opts[:'userid'] if !opts[:'userid'].nil?
866
+ header_params[:'x-token'] = opts[:'x_token'] if !opts[:'x_token'].nil?
867
+ header_params[:'original'] = opts[:'original'] if !opts[:'original'].nil?
868
+
869
+ # form parameters
870
+ form_params = opts[:form_params] || {}
871
+
872
+ # http body (model)
873
+ post_body = opts[:body]
874
+
875
+ return_type = opts[:return_type] || 'Object'
876
+
877
+ auth_names = opts[:auth_names] || []
878
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
879
+ :header_params => header_params,
880
+ :query_params => query_params,
881
+ :form_params => form_params,
882
+ :body => post_body,
883
+ :auth_names => auth_names,
884
+ :return_type => return_type)
885
+
886
+ if @api_client.config.debugging
887
+ @api_client.config.logger.debug "API called: SearchApi#search_widget_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
888
+ end
889
+ return data, status_code, headers
890
+ end
891
+ end
892
+ end