elasticsearch-serverless 0.6.0 → 0.7.0

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 (249) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch-serverless/api/async_search/delete.rb +3 -4
  3. data/lib/elasticsearch-serverless/api/async_search/get.rb +4 -5
  4. data/lib/elasticsearch-serverless/api/async_search/status.rb +7 -6
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +5 -7
  6. data/lib/elasticsearch-serverless/api/bulk.rb +109 -22
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +17 -14
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +14 -13
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +13 -14
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +5 -15
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +10 -11
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +7 -13
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +6 -12
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +6 -12
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +7 -12
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +6 -12
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +7 -6
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +3 -3
  19. data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +3 -5
  20. data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +4 -5
  21. data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +5 -6
  22. data/lib/elasticsearch-serverless/api/cluster/info.rb +3 -4
  23. data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +6 -5
  24. data/lib/elasticsearch-serverless/api/connector/check_in.rb +3 -4
  25. data/lib/elasticsearch-serverless/api/connector/delete.rb +4 -4
  26. data/lib/elasticsearch-serverless/api/connector/get.rb +5 -5
  27. data/lib/elasticsearch-serverless/api/connector/list.rb +4 -3
  28. data/lib/elasticsearch-serverless/api/connector/post.rb +3 -3
  29. data/lib/elasticsearch-serverless/api/connector/put.rb +4 -5
  30. data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +7 -6
  31. data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +7 -6
  32. data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +7 -6
  33. data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +3 -3
  34. data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +3 -3
  35. data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +3 -4
  36. data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +3 -4
  37. data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +3 -4
  38. data/lib/elasticsearch-serverless/api/connector/update_error.rb +3 -4
  39. data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +3 -4
  40. data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +2 -3
  41. data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +3 -4
  42. data/lib/elasticsearch-serverless/api/connector/update_name.rb +3 -4
  43. data/lib/elasticsearch-serverless/api/connector/update_native.rb +2 -3
  44. data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +3 -4
  45. data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +3 -4
  46. data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +3 -4
  47. data/lib/elasticsearch-serverless/api/connector/update_status.rb +3 -4
  48. data/lib/elasticsearch-serverless/api/count.rb +36 -25
  49. data/lib/elasticsearch-serverless/api/create.rb +77 -22
  50. data/lib/elasticsearch-serverless/api/delete.rb +44 -18
  51. data/lib/elasticsearch-serverless/api/delete_by_query.rb +91 -29
  52. data/lib/elasticsearch-serverless/api/delete_script.rb +10 -9
  53. data/lib/elasticsearch-serverless/api/enrich/delete_policy.rb +5 -5
  54. data/lib/elasticsearch-serverless/api/enrich/execute_policy.rb +6 -5
  55. data/lib/elasticsearch-serverless/api/enrich/get_policy.rb +6 -6
  56. data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +5 -5
  57. data/lib/elasticsearch-serverless/api/eql/delete.rb +5 -5
  58. data/lib/elasticsearch-serverless/api/eql/get.rb +5 -5
  59. data/lib/elasticsearch-serverless/api/eql/get_status.rb +5 -5
  60. data/lib/elasticsearch-serverless/api/eql/search.rb +9 -5
  61. data/lib/elasticsearch-serverless/api/exists.rb +38 -19
  62. data/lib/elasticsearch-serverless/api/exists_source.rb +23 -18
  63. data/lib/elasticsearch-serverless/api/explain.rb +25 -16
  64. data/lib/elasticsearch-serverless/api/field_caps.rb +11 -10
  65. data/lib/elasticsearch-serverless/api/get.rb +71 -21
  66. data/lib/elasticsearch-serverless/api/get_script.rb +7 -6
  67. data/lib/elasticsearch-serverless/api/get_source.rb +25 -15
  68. data/lib/elasticsearch-serverless/api/graph/explore.rb +9 -5
  69. data/lib/elasticsearch-serverless/api/index.rb +110 -21
  70. data/lib/elasticsearch-serverless/api/indices/add_block.rb +23 -12
  71. data/lib/elasticsearch-serverless/api/indices/analyze.rb +9 -6
  72. data/lib/elasticsearch-serverless/api/indices/create.rb +19 -6
  73. data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +3 -5
  74. data/lib/elasticsearch-serverless/api/indices/delete.rb +11 -8
  75. data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +4 -7
  76. data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +3 -4
  77. data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +3 -4
  78. data/lib/elasticsearch-serverless/api/indices/exists.rb +7 -8
  79. data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +8 -7
  80. data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +6 -6
  81. data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +4 -5
  82. data/lib/elasticsearch-serverless/api/indices/get.rb +5 -6
  83. data/lib/elasticsearch-serverless/api/indices/get_alias.rb +6 -5
  84. data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +4 -5
  85. data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +5 -6
  86. data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +5 -6
  87. data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +4 -6
  88. data/lib/elasticsearch-serverless/api/indices/get_settings.rb +6 -7
  89. data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +3 -4
  90. data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +3 -3
  91. data/lib/elasticsearch-serverless/api/indices/put_alias.rb +4 -7
  92. data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +4 -6
  93. data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +22 -4
  94. data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +21 -6
  95. data/lib/elasticsearch-serverless/api/indices/put_settings.rb +17 -7
  96. data/lib/elasticsearch-serverless/api/indices/refresh.rb +11 -5
  97. data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +5 -5
  98. data/lib/elasticsearch-serverless/api/indices/rollover.rb +28 -5
  99. data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +4 -5
  100. data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +5 -6
  101. data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +3 -3
  102. data/lib/elasticsearch-serverless/api/indices/validate_query.rb +4 -5
  103. data/lib/elasticsearch-serverless/api/inference/chat_completion_unified.rb +62 -0
  104. data/lib/elasticsearch-serverless/api/inference/completion.rb +62 -0
  105. data/lib/elasticsearch-serverless/api/inference/delete.rb +6 -7
  106. data/lib/elasticsearch-serverless/api/inference/get.rb +4 -5
  107. data/lib/elasticsearch-serverless/api/inference/put.rb +12 -5
  108. data/lib/elasticsearch-serverless/api/inference/put_watsonx.rb +78 -0
  109. data/lib/elasticsearch-serverless/api/inference/rerank.rb +62 -0
  110. data/lib/elasticsearch-serverless/api/inference/sparse_embedding.rb +62 -0
  111. data/lib/elasticsearch-serverless/api/inference/text_embedding.rb +62 -0
  112. data/lib/elasticsearch-serverless/api/info.rb +4 -4
  113. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +5 -5
  114. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +6 -6
  115. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +5 -4
  116. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +3 -4
  117. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +9 -8
  118. data/lib/elasticsearch-serverless/api/license/get.rb +4 -5
  119. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +7 -6
  120. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +7 -7
  121. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +7 -6
  122. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +3 -4
  123. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +4 -5
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +3 -4
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +3 -4
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +3 -4
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +3 -4
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +3 -4
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +3 -4
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +4 -4
  131. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +3 -4
  132. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +5 -5
  133. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +3 -3
  134. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +3 -4
  135. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +3 -4
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +4 -5
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +4 -5
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +4 -5
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +4 -5
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +4 -5
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +4 -5
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +4 -5
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +4 -5
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +3 -4
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +4 -5
  146. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +4 -5
  147. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +3 -9
  148. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +3 -4
  149. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +3 -4
  150. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +5 -6
  151. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +4 -5
  152. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +3 -4
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +3 -4
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +6 -4
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +6 -6
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +3 -4
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +16 -5
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +3 -4
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +3 -4
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +3 -4
  161. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +3 -4
  162. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +3 -4
  163. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +3 -4
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +3 -4
  165. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +7 -6
  166. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +3 -4
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +3 -4
  168. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +3 -4
  169. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +3 -4
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +3 -4
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +3 -4
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +3 -4
  173. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +3 -4
  174. data/lib/elasticsearch-serverless/api/mget.rb +12 -5
  175. data/lib/elasticsearch-serverless/api/msearch.rb +16 -17
  176. data/lib/elasticsearch-serverless/api/msearch_template.rb +22 -15
  177. data/lib/elasticsearch-serverless/api/mtermvectors.rb +15 -12
  178. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +29 -12
  179. data/lib/elasticsearch-serverless/api/ping.rb +8 -10
  180. data/lib/elasticsearch-serverless/api/put_script.rb +12 -11
  181. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +6 -5
  182. data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +6 -5
  183. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +5 -5
  184. data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +5 -5
  185. data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +7 -6
  186. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +11 -7
  187. data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +11 -6
  188. data/lib/elasticsearch-serverless/api/query_rules/test.rb +5 -5
  189. data/lib/elasticsearch-serverless/api/rank_eval.rb +6 -6
  190. data/lib/elasticsearch-serverless/api/reindex.rb +146 -9
  191. data/lib/elasticsearch-serverless/api/render_search_template.rb +5 -6
  192. data/lib/elasticsearch-serverless/api/response.rb +1 -1
  193. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +7 -3
  194. data/lib/elasticsearch-serverless/api/scroll.rb +4 -4
  195. data/lib/elasticsearch-serverless/api/search.rb +77 -69
  196. data/lib/elasticsearch-serverless/api/search_application/delete.rb +4 -5
  197. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +3 -4
  198. data/lib/elasticsearch-serverless/api/search_application/get.rb +3 -4
  199. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +4 -5
  200. data/lib/elasticsearch-serverless/api/search_application/list.rb +5 -4
  201. data/lib/elasticsearch-serverless/api/search_application/put.rb +3 -4
  202. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +3 -4
  203. data/lib/elasticsearch-serverless/api/search_application/search.rb +3 -4
  204. data/lib/elasticsearch-serverless/api/search_mvt.rb +131 -9
  205. data/lib/elasticsearch-serverless/api/search_template.rb +12 -12
  206. data/lib/elasticsearch-serverless/api/security/authenticate.rb +3 -3
  207. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +7 -3
  208. data/lib/elasticsearch-serverless/api/security/delete_role.rb +6 -5
  209. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +3 -3
  210. data/lib/elasticsearch-serverless/api/security/get_builtin_privileges.rb +3 -3
  211. data/lib/elasticsearch-serverless/api/security/get_role.rb +11 -8
  212. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +6 -5
  213. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +8 -6
  214. data/lib/elasticsearch-serverless/api/security/put_role.rb +3 -4
  215. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +12 -6
  216. data/lib/elasticsearch-serverless/api/security/query_role.rb +61 -0
  217. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +74 -0
  218. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +4 -4
  219. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +10 -6
  220. data/lib/elasticsearch-serverless/api/sql/get_async.rb +16 -13
  221. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +6 -6
  222. data/lib/elasticsearch-serverless/api/sql/query.rb +8 -5
  223. data/lib/elasticsearch-serverless/api/sql/translate.rb +6 -4
  224. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +17 -6
  225. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +7 -7
  226. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +7 -8
  227. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +7 -7
  228. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +7 -6
  229. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -6
  230. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -7
  231. data/lib/elasticsearch-serverless/api/tasks/get.rb +9 -7
  232. data/lib/elasticsearch-serverless/api/terms_enum.rb +7 -9
  233. data/lib/elasticsearch-serverless/api/termvectors.rb +39 -16
  234. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +3 -5
  235. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +5 -6
  236. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +4 -5
  237. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +4 -5
  238. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +3 -4
  239. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +4 -5
  240. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +7 -8
  241. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +3 -5
  242. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +3 -4
  243. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +3 -4
  244. data/lib/elasticsearch-serverless/api/update.rb +36 -24
  245. data/lib/elasticsearch-serverless/api/update_by_query.rb +102 -31
  246. data/lib/elasticsearch-serverless/api.rb +22 -25
  247. data/lib/elasticsearch-serverless/version.rb +1 -1
  248. data/lib/elasticsearch-serverless.rb +7 -0
  249. metadata +18 -7
@@ -36,14 +36,13 @@ module ElasticsearchServerless
36
36
  # reset.
37
37
  # @option arguments [Hash] :headers Custom HTTP headers
38
38
  #
39
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html
39
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-reset-job
40
40
  #
41
41
  def reset_job(arguments = {})
42
- request_opts = { endpoint: arguments[:endpoint] || "ml.reset_job" }
42
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.reset_job' }
43
43
 
44
- defined_params = [:job_id].inject({}) do |set_variables, variable|
44
+ defined_params = [:job_id].each_with_object({}) do |variable, set_variables|
45
45
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
46
- set_variables
47
46
  end
48
47
  request_opts[:defined_params] = defined_params unless defined_params.empty?
49
48
 
@@ -42,14 +42,13 @@ module ElasticsearchServerless
42
42
  # starts. Server default: 20s.
43
43
  # @option arguments [Hash] :headers Custom HTTP headers
44
44
  #
45
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-data-frame-analytics
46
46
  #
47
47
  def start_data_frame_analytics(arguments = {})
48
- request_opts = { endpoint: arguments[:endpoint] || "ml.start_data_frame_analytics" }
48
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.start_data_frame_analytics' }
49
49
 
50
- defined_params = [:id].inject({}) do |set_variables, variable|
50
+ defined_params = [:id].each_with_object({}) do |variable, set_variables|
51
51
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
- set_variables
53
52
  end
54
53
  request_opts[:defined_params] = defined_params unless defined_params.empty?
55
54
 
@@ -54,14 +54,13 @@ module ElasticsearchServerless
54
54
  # @option arguments [Hash] :headers Custom HTTP headers
55
55
  # @option arguments [Hash] :body request body
56
56
  #
57
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html
57
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-datafeed
58
58
  #
59
59
  def start_datafeed(arguments = {})
60
- request_opts = { endpoint: arguments[:endpoint] || "ml.start_datafeed" }
60
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.start_datafeed' }
61
61
 
62
- defined_params = [:datafeed_id].inject({}) do |set_variables, variable|
62
+ defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables|
63
63
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
64
- set_variables
65
64
  end
66
65
  request_opts[:defined_params] = defined_params unless defined_params.empty?
67
66
 
@@ -35,7 +35,8 @@ module ElasticsearchServerless
35
35
  # a separate set of threads to evaluate the model.
36
36
  # Increasing this value generally increases the throughput.
37
37
  # If this setting is greater than the number of hardware threads
38
- # it will automatically be changed to a value less than the number of hardware threads. Server default: 1.
38
+ # it will automatically be changed to a value less than the number of hardware threads.
39
+ # If adaptive_allocations is enabled, do not set this value, because it’s automatically set. Server default: 1.
39
40
  # @option arguments [String] :priority The deployment priority.
40
41
  # @option arguments [Integer] :queue_capacity Specifies the number of inference requests that are allowed in the queue. After the number of requests exceeds
41
42
  # this value, new requests are rejected with a 429 error. Server default: 1024.
@@ -47,15 +48,15 @@ module ElasticsearchServerless
47
48
  # @option arguments [Time] :timeout Specifies the amount of time to wait for the model to deploy. Server default: 20s.
48
49
  # @option arguments [String] :wait_for Specifies the allocation status to wait for before returning. Server default: started.
49
50
  # @option arguments [Hash] :headers Custom HTTP headers
51
+ # @option arguments [Hash] :body request body
50
52
  #
51
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trained-model-deployment.html
53
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-trained-model-deployment
52
54
  #
53
55
  def start_trained_model_deployment(arguments = {})
54
- request_opts = { endpoint: arguments[:endpoint] || "ml.start_trained_model_deployment" }
56
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.start_trained_model_deployment' }
55
57
 
56
- defined_params = [:model_id].inject({}) do |set_variables, variable|
58
+ defined_params = [:model_id].each_with_object({}) do |variable, set_variables|
57
59
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
58
- set_variables
59
60
  end
60
61
  request_opts[:defined_params] = defined_params unless defined_params.empty?
61
62
 
@@ -64,7 +65,7 @@ module ElasticsearchServerless
64
65
  arguments = arguments.clone
65
66
  headers = arguments.delete(:headers) || {}
66
67
 
67
- body = nil
68
+ body = arguments.delete(:body)
68
69
 
69
70
  _model_id = arguments.delete(:model_id)
70
71
 
@@ -43,14 +43,13 @@ module ElasticsearchServerless
43
43
  # stops. Defaults to 20 seconds. Server default: 20s.
44
44
  # @option arguments [Hash] :headers Custom HTTP headers
45
45
  #
46
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html
46
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-data-frame-analytics
47
47
  #
48
48
  def stop_data_frame_analytics(arguments = {})
49
- request_opts = { endpoint: arguments[:endpoint] || "ml.stop_data_frame_analytics" }
49
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_data_frame_analytics' }
50
50
 
51
- defined_params = [:id].inject({}) do |set_variables, variable|
51
+ defined_params = [:id].each_with_object({}) do |variable, set_variables|
52
52
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
53
- set_variables
54
53
  end
55
54
  request_opts[:defined_params] = defined_params unless defined_params.empty?
56
55
 
@@ -41,14 +41,13 @@ module ElasticsearchServerless
41
41
  # @option arguments [Hash] :headers Custom HTTP headers
42
42
  # @option arguments [Hash] :body request body
43
43
  #
44
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html
44
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-datafeed
45
45
  #
46
46
  def stop_datafeed(arguments = {})
47
- request_opts = { endpoint: arguments[:endpoint] || "ml.stop_datafeed" }
47
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_datafeed' }
48
48
 
49
- defined_params = [:datafeed_id].inject({}) do |set_variables, variable|
49
+ defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables|
50
50
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
51
- set_variables
52
51
  end
53
52
  request_opts[:defined_params] = defined_params unless defined_params.empty?
54
53
 
@@ -33,14 +33,13 @@ module ElasticsearchServerless
33
33
  # restart the model deployment.
34
34
  # @option arguments [Hash] :headers Custom HTTP headers
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/stop-trained-model-deployment.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-trained-model-deployment
37
37
  #
38
38
  def stop_trained_model_deployment(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "ml.stop_trained_model_deployment" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_trained_model_deployment' }
40
40
 
41
- defined_params = [:model_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:model_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
@@ -30,14 +30,13 @@ module ElasticsearchServerless
30
30
  # @option arguments [Hash] :headers Custom HTTP headers
31
31
  # @option arguments [Hash] :body request body
32
32
  #
33
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html
33
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-data-frame-analytics
34
34
  #
35
35
  def update_data_frame_analytics(arguments = {})
36
- request_opts = { endpoint: arguments[:endpoint] || "ml.update_data_frame_analytics" }
36
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.update_data_frame_analytics' }
37
37
 
38
- defined_params = [:id].inject({}) do |set_variables, variable|
38
+ defined_params = [:id].each_with_object({}) do |variable, set_variables|
39
39
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
40
- set_variables
41
40
  end
42
41
  request_opts[:defined_params] = defined_params unless defined_params.empty?
43
42
 
@@ -45,14 +45,13 @@ module ElasticsearchServerless
45
45
  # @option arguments [Hash] :headers Custom HTTP headers
46
46
  # @option arguments [Hash] :body request body
47
47
  #
48
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html
48
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-datafeed
49
49
  #
50
50
  def update_datafeed(arguments = {})
51
- request_opts = { endpoint: arguments[:endpoint] || "ml.update_datafeed" }
51
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.update_datafeed' }
52
52
 
53
- defined_params = [:datafeed_id].inject({}) do |set_variables, variable|
53
+ defined_params = [:datafeed_id].each_with_object({}) do |variable, set_variables|
54
54
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
55
- set_variables
56
55
  end
57
56
  request_opts[:defined_params] = defined_params unless defined_params.empty?
58
57
 
@@ -29,14 +29,13 @@ module ElasticsearchServerless
29
29
  # @option arguments [Hash] :headers Custom HTTP headers
30
30
  # @option arguments [Hash] :body request body
31
31
  #
32
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html
32
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-filter
33
33
  #
34
34
  def update_filter(arguments = {})
35
- request_opts = { endpoint: arguments[:endpoint] || "ml.update_filter" }
35
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.update_filter' }
36
36
 
37
- defined_params = [:filter_id].inject({}) do |set_variables, variable|
37
+ defined_params = [:filter_id].each_with_object({}) do |variable, set_variables|
38
38
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
- set_variables
40
39
  end
41
40
  request_opts[:defined_params] = defined_params unless defined_params.empty?
42
41
 
@@ -29,14 +29,13 @@ module ElasticsearchServerless
29
29
  # @option arguments [Hash] :headers Custom HTTP headers
30
30
  # @option arguments [Hash] :body request body
31
31
  #
32
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html
32
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-job
33
33
  #
34
34
  def update_job(arguments = {})
35
- request_opts = { endpoint: arguments[:endpoint] || "ml.update_job" }
35
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.update_job' }
36
36
 
37
- defined_params = [:job_id].inject({}) do |set_variables, variable|
37
+ defined_params = [:job_id].each_with_object({}) do |variable, set_variables|
38
38
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
- set_variables
40
39
  end
41
40
  request_opts[:defined_params] = defined_params unless defined_params.empty?
42
41
 
@@ -34,14 +34,13 @@ module ElasticsearchServerless
34
34
  # @option arguments [Hash] :headers Custom HTTP headers
35
35
  # @option arguments [Hash] :body request body
36
36
  #
37
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html
37
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-trained-model-deployment
38
38
  #
39
39
  def update_trained_model_deployment(arguments = {})
40
- request_opts = { endpoint: arguments[:endpoint] || "ml.update_trained_model_deployment" }
40
+ request_opts = { endpoint: arguments[:endpoint] || 'ml.update_trained_model_deployment' }
41
41
 
42
- defined_params = [:model_id].inject({}) do |set_variables, variable|
42
+ defined_params = [:model_id].each_with_object({}) do |variable, set_variables|
43
43
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
44
- set_variables
45
44
  end
46
45
  request_opts[:defined_params] = defined_params unless defined_params.empty?
47
46
 
@@ -25,6 +25,14 @@ module ElasticsearchServerless
25
25
  # Get multiple JSON documents by ID from one or more indices.
26
26
  # If you specify an index in the request URI, you only need to specify the document IDs in the request body.
27
27
  # To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail.
28
+ # **Filter source fields**
29
+ # By default, the +_source+ field is returned for every document (if stored).
30
+ # Use the +_source+ and +_source_include+ or +source_exclude+ attributes to filter what fields are returned for a particular document.
31
+ # You can include the +_source+, +_source_includes+, and +_source_excludes+ query parameters in the request URI to specify the defaults to use when there are no per-document instructions.
32
+ # **Get stored fields**
33
+ # Use the +stored_fields+ attribute to specify the set of stored fields you want to retrieve.
34
+ # Any requested fields that are not stored are ignored.
35
+ # You can include the +stored_fields+ query parameter in the request URI to specify the defaults to use when there are no per-document instructions.
28
36
  #
29
37
  # @option arguments [String] :index Name of the index to retrieve documents from when +ids+ are specified, or when a document in the +docs+ array does not specify an index.
30
38
  # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source?
@@ -44,14 +52,13 @@ module ElasticsearchServerless
44
52
  # @option arguments [Hash] :headers Custom HTTP headers
45
53
  # @option arguments [Hash] :body request body
46
54
  #
47
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html
55
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-mget
48
56
  #
49
57
  def mget(arguments = {})
50
- request_opts = { endpoint: arguments[:endpoint] || "mget" }
58
+ request_opts = { endpoint: arguments[:endpoint] || 'mget' }
51
59
 
52
- defined_params = [:index].inject({}) do |set_variables, variable|
60
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
53
61
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
54
- set_variables
55
62
  end
56
63
  request_opts[:defined_params] = defined_params unless defined_params.empty?
57
64
 
@@ -68,7 +75,7 @@ module ElasticsearchServerless
68
75
  path = if _index
69
76
  "#{Utils.listify(_index)}/_mget"
70
77
  else
71
- "_mget"
78
+ '_mget'
72
79
  end
73
80
  params = Utils.process_params(arguments)
74
81
 
@@ -24,10 +24,12 @@ module ElasticsearchServerless
24
24
  # Run multiple searches.
25
25
  # The format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format.
26
26
  # The structure is as follows:
27
- # header
28
- # body
29
- # header
30
- # body
27
+ # +
28
+ # header\n
29
+ # body\n
30
+ # header\n
31
+ # body\n
32
+ # +
31
33
  # This structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node.
32
34
  # IMPORTANT: The final line of data must end with a newline character +\n+.
33
35
  # Each newline character may be preceded by a carriage return +\r+.
@@ -55,14 +57,13 @@ module ElasticsearchServerless
55
57
  # @option arguments [Hash] :headers Custom HTTP headers
56
58
  # @option arguments [Hash] :body searches
57
59
  #
58
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html
60
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch
59
61
  #
60
62
  def msearch(arguments = {})
61
- request_opts = { endpoint: arguments[:endpoint] || "msearch" }
63
+ request_opts = { endpoint: arguments[:endpoint] || 'msearch' }
62
64
 
63
- defined_params = [:index].inject({}) do |set_variables, variable|
65
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
64
66
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
65
- set_variables
66
67
  end
67
68
  request_opts[:defined_params] = defined_params unless defined_params.empty?
68
69
 
@@ -79,31 +80,29 @@ module ElasticsearchServerless
79
80
  path = if _index
80
81
  "#{Utils.listify(_index)}/_msearch"
81
82
  else
82
- "_msearch"
83
+ '_msearch'
83
84
  end
84
85
  params = Utils.process_params(arguments)
85
86
 
86
- case
87
- when body.is_a?(Array) && body.any? { |d| d.has_key? :search }
88
- payload = body.inject([]) do |sum, item|
87
+ if body.is_a?(Array) && body.any? { |d| d.key? :search }
88
+ payload = body.each_with_object([]) do |item, sum|
89
89
  meta = item
90
90
  data = meta.delete(:search)
91
91
 
92
92
  sum << meta
93
93
  sum << data
94
- sum
95
94
  end.map { |item| ElasticsearchServerless::API.serializer.dump(item) }
96
- payload << "" unless payload.empty?
95
+ payload << '' unless payload.empty?
97
96
  payload = payload.join("\n")
98
- when body.is_a?(Array)
97
+ elsif body.is_a?(Array)
99
98
  payload = body.map { |d| d.is_a?(String) ? d : ElasticsearchServerless::API.serializer.dump(d) }
100
- payload << "" unless payload.empty?
99
+ payload << '' unless payload.empty?
101
100
  payload = payload.join("\n")
102
101
  else
103
102
  payload = body
104
103
  end
105
104
 
106
- headers.merge!("Content-Type" => "application/x-ndjson")
105
+ headers.merge!('Content-Type' => 'application/x-ndjson')
107
106
  ElasticsearchServerless::API::Response.new(
108
107
  perform_request(method, path, params, payload, headers, request_opts)
109
108
  )
@@ -22,28 +22,37 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Run multiple templated searches.
25
+ # Run multiple templated searches with a single request.
26
+ # If you are providing a text file or text input to +curl+, use the +--data-binary+ flag instead of +-d+ to preserve newlines.
27
+ # For example:
28
+ # +
29
+ # $ cat requests
30
+ # { "index": "my-index" }
31
+ # { "id": "my-search-template", "params": { "query_string": "hello world", "from": 0, "size": 10 }}
32
+ # { "index": "my-other-index" }
33
+ # { "id": "my-other-search-template", "params": { "query_type": "match_all" }}
34
+ # $ curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch/template --data-binary "@requests"; echo
35
+ # +
25
36
  #
26
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search.
27
- # Supports wildcards (+*+).
37
+ # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search.
38
+ # It supports wildcards (+*+).
28
39
  # To search all data streams and indices, omit this parameter or use +*+.
29
40
  # @option arguments [Boolean] :ccs_minimize_roundtrips If +true+, network round-trips are minimized for cross-cluster search requests. Server default: true.
30
- # @option arguments [Integer] :max_concurrent_searches Maximum number of concurrent searches the API can run.
41
+ # @option arguments [Integer] :max_concurrent_searches The maximum number of concurrent searches the API can run.
31
42
  # @option arguments [String] :search_type The type of the search operation.
32
- # Available options: +query_then_fetch+, +dfs_query_then_fetch+.
33
43
  # @option arguments [Boolean] :rest_total_hits_as_int If +true+, the response returns +hits.total+ as an integer.
34
44
  # If +false+, it returns +hits.total+ as an object.
35
45
  # @option arguments [Boolean] :typed_keys If +true+, the response prefixes aggregation and suggester names with their respective types.
36
46
  # @option arguments [Hash] :headers Custom HTTP headers
37
47
  # @option arguments [Hash] :body search_templates
38
48
  #
39
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html
49
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch-template
40
50
  #
41
51
  def msearch_template(arguments = {})
42
- request_opts = { endpoint: arguments[:endpoint] || "msearch_template" }
52
+ request_opts = { endpoint: arguments[:endpoint] || 'msearch_template' }
43
53
 
44
- defined_params = [:index].inject({}) do |set_variables, variable|
54
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
45
55
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
46
- set_variables
47
56
  end
48
57
  request_opts[:defined_params] = defined_params unless defined_params.empty?
49
58
 
@@ -60,21 +69,19 @@ module ElasticsearchServerless
60
69
  path = if _index
61
70
  "#{Utils.listify(_index)}/_msearch/template"
62
71
  else
63
- "_msearch/template"
72
+ '_msearch/template'
64
73
  end
65
74
  params = Utils.process_params(arguments)
66
75
 
67
- case
68
- when body.is_a?(Array)
76
+ if body.is_a?(Array)
69
77
  payload = body.map { |d| d.is_a?(String) ? d : ElasticsearchServerless::API.serializer.dump(d) }
70
- payload << "" unless payload.empty?
71
- payload = payload.join("
72
- ")
78
+ payload << '' unless payload.empty?
79
+ payload = payload.join("\n")
73
80
  else
74
81
  payload = body
75
82
  end
76
83
 
77
- headers.merge!("Content-Type" => "application/x-ndjson")
84
+ headers.merge!('Content-Type' => 'application/x-ndjson')
78
85
  ElasticsearchServerless::API::Response.new(
79
86
  perform_request(method, path, params, payload, headers, request_opts)
80
87
  )
@@ -22,37 +22,40 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Get multiple term vectors.
25
+ # Get multiple term vectors with a single request.
25
26
  # You can specify existing documents by index and ID or provide artificial documents in the body of the request.
26
27
  # You can specify the index in the request body or request URI.
27
28
  # The response contains a +docs+ array with all the fetched termvectors.
28
29
  # Each element has the structure provided by the termvectors API.
30
+ # **Artificial documents**
31
+ # You can also use +mtermvectors+ to generate term vectors for artificial documents provided in the body of the request.
32
+ # The mapping used is determined by the specified +_index+.
29
33
  #
30
- # @option arguments [String] :index Name of the index that contains the documents.
34
+ # @option arguments [String] :index The name of the index that contains the documents.
31
35
  # @option arguments [Array<String>] :ids A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
32
- # @option arguments [String, Array<String>] :fields Comma-separated list or wildcard expressions of fields to include in the statistics.
33
- # Used as the default list unless a specific field list is provided in the +completion_fields+ or +fielddata_fields+ parameters.
36
+ # @option arguments [String, Array<String>] :fields A comma-separated list or wildcard expressions of fields to include in the statistics.
37
+ # It is used as the default list unless a specific field list is provided in the +completion_fields+ or +fielddata_fields+ parameters.
34
38
  # @option arguments [Boolean] :field_statistics If +true+, the response includes the document count, sum of document frequencies, and sum of total term frequencies. Server default: true.
35
39
  # @option arguments [Boolean] :offsets If +true+, the response includes term offsets. Server default: true.
36
40
  # @option arguments [Boolean] :payloads If +true+, the response includes term payloads. Server default: true.
37
41
  # @option arguments [Boolean] :positions If +true+, the response includes term positions. Server default: true.
38
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
39
- # Random by default.
42
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
43
+ # It is random by default.
40
44
  # @option arguments [Boolean] :realtime If true, the request is real-time as opposed to near-real-time. Server default: true.
41
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
45
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
42
46
  # @option arguments [Boolean] :term_statistics If true, the response includes term frequency and document frequency.
43
47
  # @option arguments [Integer] :version If +true+, returns the document version as part of a hit.
44
- # @option arguments [String] :version_type Specific version type.
48
+ # @option arguments [String] :version_type The version type.
45
49
  # @option arguments [Hash] :headers Custom HTTP headers
46
50
  # @option arguments [Hash] :body request body
47
51
  #
48
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html
52
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-mtermvectors
49
53
  #
50
54
  def mtermvectors(arguments = {})
51
- request_opts = { endpoint: arguments[:endpoint] || "mtermvectors" }
55
+ request_opts = { endpoint: arguments[:endpoint] || 'mtermvectors' }
52
56
 
53
- defined_params = [:index].inject({}) do |set_variables, variable|
57
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
54
58
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
55
- set_variables
56
59
  end
57
60
  request_opts[:defined_params] = defined_params unless defined_params.empty?
58
61
 
@@ -72,7 +75,7 @@ module ElasticsearchServerless
72
75
  path = if _index
73
76
  "#{Utils.listify(_index)}/_mtermvectors"
74
77
  else
75
- "_mtermvectors"
78
+ '_mtermvectors'
76
79
  end
77
80
  params = Utils.process_params(arguments)
78
81
 
@@ -29,30 +29,47 @@ module ElasticsearchServerless
29
29
  # +search_after+ requests, then the results of those requests might not be consistent as changes happening
30
30
  # between searches are only visible to the more recent point in time.
31
31
  # A point in time must be opened explicitly before being used in search requests.
32
- # The +keep_alive+ parameter tells Elasticsearch how long it should persist.
32
+ # A subsequent search request with the +pit+ parameter must not specify +index+, +routing+, or +preference+ values as these parameters are copied from the point in time.
33
+ # Just like regular searches, you can use +from+ and +size+ to page through point in time search results, up to the first 10,000 hits.
34
+ # If you want to retrieve more hits, use PIT with +search_after+.
35
+ # IMPORTANT: The open point in time request and each subsequent search request can return different identifiers; always use the most recently received ID for the next search request.
36
+ # When a PIT that contains shard failures is used in a search request, the missing are always reported in the search response as a +NoShardAvailableActionException+ exception.
37
+ # To get rid of these exceptions, a new PIT needs to be created so that shards missing from the previous PIT can be handled, assuming they become available in the meantime.
38
+ # **Keeping point in time alive**
39
+ # The +keep_alive+ parameter, which is passed to a open point in time request and search request, extends the time to live of the corresponding point in time.
40
+ # The value does not need to be long enough to process all data — it just needs to be long enough for the next request.
41
+ # Normally, the background merge process optimizes the index by merging together smaller segments to create new, bigger segments.
42
+ # Once the smaller segments are no longer needed they are deleted.
43
+ # However, open point-in-times prevent the old segments from being deleted since they are still in use.
44
+ # TIP: Keeping older segments alive means that more disk space and file handles are needed.
45
+ # Ensure that you have configured your nodes to have ample free file handles.
46
+ # Additionally, if a segment contains deleted or updated documents then the point in time must keep track of whether each document in the segment was live at the time of the initial search request.
47
+ # Ensure that your nodes have sufficient heap space if you have many open point-in-times on an index that is subject to ongoing deletes or updates.
48
+ # Note that a point-in-time doesn't prevent its associated indices from being deleted.
49
+ # You can check how many point-in-times (that is, search contexts) are open with the nodes stats API.
33
50
  #
34
51
  # @option arguments [String, Array] :index A comma-separated list of index names to open point in time; use +_all+ or empty string to perform the operation on all indices (*Required*)
35
- # @option arguments [Time] :keep_alive Extends the time to live of the corresponding point in time. (*Required*)
52
+ # @option arguments [Time] :keep_alive Extend the length of time that the point in time persists. (*Required*)
36
53
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
37
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
38
- # Random by default.
39
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
40
- # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
54
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
55
+ # By default, it is random.
56
+ # @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
57
+ # @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
41
58
  # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
42
- # Supports comma-separated values, such as +open,hidden+. Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open.
43
- # @option arguments [Boolean] :allow_partial_search_results If +false+, creating a point in time request when a shard is missing or unavailable will throw an exception.
59
+ # It supports comma-separated values, such as +open,hidden+. Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open.
60
+ # @option arguments [Boolean] :allow_partial_search_results Indicates whether the point in time tolerates unavailable shards or shard failures when initially creating the PIT.
61
+ # If +false+, creating a point in time request when a shard is missing or unavailable will throw an exception.
44
62
  # If +true+, the point in time will contain all the shards that are available at the time of the request.
45
63
  # @option arguments [Hash] :headers Custom HTTP headers
46
64
  # @option arguments [Hash] :body request body
47
65
  #
48
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html
66
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time
49
67
  #
50
68
  def open_point_in_time(arguments = {})
51
- request_opts = { endpoint: arguments[:endpoint] || "open_point_in_time" }
69
+ request_opts = { endpoint: arguments[:endpoint] || 'open_point_in_time' }
52
70
 
53
- defined_params = [:index].inject({}) do |set_variables, variable|
71
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
54
72
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
55
- set_variables
56
73
  end
57
74
  request_opts[:defined_params] = defined_params unless defined_params.empty?
58
75
 
@@ -22,14 +22,14 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Ping the cluster.
25
- # Returns whether the cluster is running.
25
+ # Get information about whether the cluster is running.
26
26
  #
27
27
  # @option arguments [Hash] :headers Custom HTTP headers
28
28
  #
29
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
29
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cluster
30
30
  #
31
31
  def ping(arguments = {})
32
- request_opts = { endpoint: arguments[:endpoint] || "ping" }
32
+ request_opts = { endpoint: arguments[:endpoint] || 'ping' }
33
33
 
34
34
  arguments = arguments.clone
35
35
  headers = arguments.delete(:headers) || {}
@@ -37,17 +37,15 @@ module ElasticsearchServerless
37
37
  body = nil
38
38
 
39
39
  method = ElasticsearchServerless::API::HTTP_HEAD
40
- path = ""
40
+ path = ''
41
41
  params = {}
42
42
 
43
43
  begin
44
- perform_request(method, path, params, body, headers, request_opts).status == 200 ? true : false
44
+ perform_request(method, path, params, body, headers, request_opts).status == 200
45
45
  rescue Exception => e
46
- if e.class.to_s =~ /NotFound|ConnectionFailed/ || e.message =~ /Not *Found|404|ConnectionFailed/i
47
- false
48
- else
49
- raise e
50
- end
46
+ raise e unless e.class.to_s =~ /NotFound|ConnectionFailed/ || e.message =~ /Not *Found|404|ConnectionFailed/i
47
+
48
+ false
51
49
  end
52
50
  end
53
51
  end