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
@@ -23,7 +23,6 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Reset a transform.
26
- # Resets a transform.
27
26
  # Before you can reset it, you must stop it; alternatively, use the +force+ query parameter.
28
27
  # If the destination index was created by the transform, it is deleted.
29
28
  #
@@ -31,16 +30,16 @@ module ElasticsearchServerless
31
30
  # hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (*Required*)
32
31
  # @option arguments [Boolean] :force If this value is +true+, the transform is reset regardless of its current state. If it's +false+, the transform
33
32
  # must be stopped before it can be reset.
33
+ # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
34
34
  # @option arguments [Hash] :headers Custom HTTP headers
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-reset-transform
37
37
  #
38
38
  def reset_transform(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "transform.reset_transform" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.reset_transform' }
40
40
 
41
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:transform_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
 
@@ -23,24 +23,23 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Schedule a transform to start now.
26
- # Instantly runs a transform to process data.
27
- # If you _schedule_now a transform, it will process the new data instantly,
28
- # without waiting for the configured frequency interval. After _schedule_now API is called,
29
- # the transform will be processed again at now + frequency unless _schedule_now API
26
+ # Instantly run a transform to process data.
27
+ # If you run this API, the transform will process the new data instantly,
28
+ # without waiting for the configured frequency interval. After the API is called,
29
+ # the transform will be processed again at +now + frequency+ unless the API
30
30
  # is called again in the meantime.
31
31
  #
32
32
  # @option arguments [String] :transform_id Identifier for the transform. (*Required*)
33
33
  # @option arguments [Time] :timeout Controls the time to wait for the scheduling to take place Server default: 30s.
34
34
  # @option arguments [Hash] :headers Custom HTTP headers
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-schedule-now-transform
37
37
  #
38
38
  def schedule_now_transform(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "transform.schedule_now_transform" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.schedule_now_transform' }
40
40
 
41
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:transform_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
 
@@ -23,7 +23,6 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Start a transform.
26
- # Starts a transform.
27
26
  # When you start a transform, it creates the destination index if it does not already exist. The +number_of_shards+ is
28
27
  # set to +1+ and the +auto_expand_replicas+ is set to +0-1+. If it is a pivot transform, it deduces the mapping
29
28
  # definitions for the destination index from the source indices and the transform aggregations. If fields in the
@@ -43,14 +42,13 @@ module ElasticsearchServerless
43
42
  # @option arguments [String] :from Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms.
44
43
  # @option arguments [Hash] :headers Custom HTTP headers
45
44
  #
46
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-start-transform
47
46
  #
48
47
  def start_transform(arguments = {})
49
- request_opts = { endpoint: arguments[:endpoint] || "transform.start_transform" }
48
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.start_transform' }
50
49
 
51
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
50
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
52
51
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
53
- set_variables
54
52
  end
55
53
  request_opts[:defined_params] = defined_params unless defined_params.empty?
56
54
 
@@ -41,14 +41,13 @@ module ElasticsearchServerless
41
41
  # immediately and the indexer is stopped asynchronously in the background.
42
42
  # @option arguments [Hash] :headers Custom HTTP headers
43
43
  #
44
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html
44
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform
45
45
  #
46
46
  def stop_transform(arguments = {})
47
- request_opts = { endpoint: arguments[:endpoint] || "transform.stop_transform" }
47
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.stop_transform' }
48
48
 
49
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
49
+ defined_params = [:transform_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
 
@@ -39,14 +39,13 @@ module ElasticsearchServerless
39
39
  # @option arguments [Hash] :headers Custom HTTP headers
40
40
  # @option arguments [Hash] :body request body
41
41
  #
42
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html
42
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-update-transform
43
43
  #
44
44
  def update_transform(arguments = {})
45
- request_opts = { endpoint: arguments[:endpoint] || "transform.update_transform" }
45
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.update_transform' }
46
46
 
47
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
47
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
48
48
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
49
- set_variables
50
49
  end
51
50
  request_opts[:defined_params] = defined_params unless defined_params.empty?
52
51
 
@@ -22,40 +22,52 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Update a document.
25
- # Updates a document by running a script or passing a partial document.
25
+ # Update a document by running a script or passing a partial document.
26
+ # If the Elasticsearch security features are enabled, you must have the +index+ or +write+ index privilege for the target index or index alias.
27
+ # The script can update, delete, or skip modifying the document.
28
+ # The API also supports passing a partial document, which is merged into the existing document.
29
+ # To fully replace an existing document, use the index API.
30
+ # This operation:
31
+ # * Gets the document (collocated with the shard) from the index.
32
+ # * Runs the specified script.
33
+ # * Indexes the result.
34
+ # The document must still be reindexed, but using this API removes some network roundtrips and reduces chances of version conflicts between the GET and the index operation.
35
+ # The +_source+ field must be enabled to use this API.
36
+ # In addition to +_source+, you can access the following variables through the +ctx+ map: +_index+, +_type+, +_id+, +_version+, +_routing+, and +_now+ (the current timestamp).
26
37
  #
27
- # @option arguments [String] :id Document ID (*Required*)
28
- # @option arguments [String] :index The name of the index (*Required*)
38
+ # @option arguments [String] :id A unique identifier for the document to be updated. (*Required*)
39
+ # @option arguments [String] :index The name of the target index.
40
+ # By default, the index is created automatically if it doesn't exist. (*Required*)
29
41
  # @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term.
30
42
  # @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number.
43
+ # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Server default: true.
31
44
  # @option arguments [String] :lang The script language. Server default: painless.
32
- # @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation
33
- # visible to search, if 'wait_for' then wait for a refresh to make this operation
34
- # visible to search, if 'false' do nothing with refreshes. Server default: false.
35
- # @option arguments [Boolean] :require_alias If true, the destination must be an index alias.
36
- # @option arguments [Integer] :retry_on_conflict Specify how many times should the operation be retried when a conflict occurs. Server default: 0.
37
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
38
- # @option arguments [Time] :timeout Period to wait for dynamic mapping updates and active shards.
39
- # This guarantees Elasticsearch waits for at least the timeout before failing.
45
+ # @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search.
46
+ # If 'wait_for', it waits for a refresh to make this operation visible to search.
47
+ # If 'false', it does nothing with refreshes. Server default: false.
48
+ # @option arguments [Boolean] :require_alias If +true+, the destination must be an index alias.
49
+ # @option arguments [Integer] :retry_on_conflict The number of times the operation should be retried when a conflict occurs. Server default: 0.
50
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
51
+ # @option arguments [Time] :timeout The period to wait for the following operations: dynamic mapping updates and waiting for active shards.
52
+ # Elasticsearch waits for at least the timeout period before failing.
40
53
  # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m.
41
- # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operations.
42
- # Set to 'all' or any positive integer up to the total number of shards in the index
43
- # (number_of_replicas+1). Defaults to 1 meaning the primary shard. Server default: 1.
44
- # @option arguments [Boolean, String, Array<String>] :_source Set to false to disable source retrieval. You can also specify a comma-separated
45
- # list of the fields you want to retrieve. Server default: true.
46
- # @option arguments [String, Array<String>] :_source_excludes Specify the source fields you want to exclude.
47
- # @option arguments [String, Array<String>] :_source_includes Specify the source fields you want to retrieve.
54
+ # @option arguments [Integer, String] :wait_for_active_shards The number of copies of each shard that must be active before proceeding with the operation.
55
+ # Set to 'all' or any positive integer up to the total number of shards in the index (+number_of_replicas++1).
56
+ # The default value of +1+ means it waits for each primary shard to be active. Server default: 1.
57
+ # @option arguments [Boolean, String, Array<String>] :_source If +false+, source retrieval is turned off.
58
+ # You can also specify a comma-separated list of the fields you want to retrieve. Server default: true.
59
+ # @option arguments [String, Array<String>] :_source_excludes The source fields you want to exclude.
60
+ # @option arguments [String, Array<String>] :_source_includes The source fields you want to retrieve.
48
61
  # @option arguments [Hash] :headers Custom HTTP headers
49
62
  # @option arguments [Hash] :body request body
50
63
  #
51
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html
64
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update
52
65
  #
53
66
  def update(arguments = {})
54
- request_opts = { endpoint: arguments[:endpoint] || "update" }
67
+ request_opts = { endpoint: arguments[:endpoint] || 'update' }
55
68
 
56
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
69
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
57
70
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
58
- set_variables
59
71
  end
60
72
  request_opts[:defined_params] = defined_params unless defined_params.empty?
61
73
 
@@ -77,11 +89,11 @@ module ElasticsearchServerless
77
89
  params = Utils.process_params(arguments)
78
90
 
79
91
  if Array(arguments[:ignore]).include?(404)
80
- Utils.rescue_from_not_found {
92
+ Utils.rescue_from_not_found do
81
93
  ElasticsearchServerless::API::Response.new(
82
94
  perform_request(method, path, params, body, headers, request_opts)
83
95
  )
84
- }
96
+ end
85
97
  else
86
98
  ElasticsearchServerless::API::Response.new(
87
99
  perform_request(method, path, params, body, headers, request_opts)
@@ -24,68 +24,139 @@ module ElasticsearchServerless
24
24
  # Update documents.
25
25
  # Updates documents that match the specified query.
26
26
  # If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.
27
+ # If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:
28
+ # * +read+
29
+ # * +index+ or +write+
30
+ # You can specify the query criteria in the request URI or the request body using the same syntax as the search API.
31
+ # When you submit an update by query request, Elasticsearch gets a snapshot of the data stream or index when it begins processing the request and updates matching documents using internal versioning.
32
+ # When the versions match, the document is updated and the version number is incremented.
33
+ # If a document changes between the time that the snapshot is taken and the update operation is processed, it results in a version conflict and the operation fails.
34
+ # You can opt to count version conflicts instead of halting and returning by setting +conflicts+ to +proceed+.
35
+ # Note that if you opt to count version conflicts, the operation could attempt to update more documents from the source than +max_docs+ until it has successfully updated +max_docs+ documents or it has gone through every document in the source query.
36
+ # NOTE: Documents with a version equal to 0 cannot be updated using update by query because internal versioning does not support 0 as a valid version number.
37
+ # While processing an update by query request, Elasticsearch performs multiple search requests sequentially to find all of the matching documents.
38
+ # A bulk update request is performed for each batch of matching documents.
39
+ # Any query or update failures cause the update by query request to fail and the failures are shown in the response.
40
+ # Any update requests that completed successfully still stick, they are not rolled back.
41
+ # **Throttling update requests**
42
+ # To control the rate at which update by query issues batches of update operations, you can set +requests_per_second+ to any positive decimal number.
43
+ # This pads each batch with a wait time to throttle the rate.
44
+ # Set +requests_per_second+ to +-1+ to turn off throttling.
45
+ # Throttling uses a wait time between batches so that the internal scroll requests can be given a timeout that takes the request padding into account.
46
+ # The padding time is the difference between the batch size divided by the +requests_per_second+ and the time spent writing.
47
+ # By default the batch size is 1000, so if +requests_per_second+ is set to +500+:
48
+ # +
49
+ # target_time = 1000 / 500 per second = 2 seconds
50
+ # wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
51
+ # +
52
+ # Since the batch is issued as a single _bulk request, large batch sizes cause Elasticsearch to create many requests and wait before starting the next set.
53
+ # This is "bursty" instead of "smooth".
54
+ # **Slicing**
55
+ # Update by query supports sliced scroll to parallelize the update process.
56
+ # This can improve efficiency and provide a convenient way to break the request down into smaller parts.
57
+ # Setting +slices+ to +auto+ chooses a reasonable number for most data streams and indices.
58
+ # This setting will use one slice per shard, up to a certain limit.
59
+ # If there are multiple source data streams or indices, it will choose the number of slices based on the index or backing index with the smallest number of shards.
60
+ # Adding +slices+ to +_update_by_query+ just automates the manual process of creating sub-requests, which means it has some quirks:
61
+ # * You can see these requests in the tasks APIs. These sub-requests are "child" tasks of the task for the request with slices.
62
+ # * Fetching the status of the task for the request with +slices+ only contains the status of completed slices.
63
+ # * These sub-requests are individually addressable for things like cancellation and rethrottling.
64
+ # * Rethrottling the request with +slices+ will rethrottle the unfinished sub-request proportionally.
65
+ # * Canceling the request with slices will cancel each sub-request.
66
+ # * Due to the nature of slices each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.
67
+ # * Parameters like +requests_per_second+ and +max_docs+ on a request with slices are distributed proportionally to each sub-request. Combine that with the point above about distribution being uneven and you should conclude that using +max_docs+ with +slices+ might not result in exactly +max_docs+ documents being updated.
68
+ # * Each sub-request gets a slightly different snapshot of the source data stream or index though these are all taken at approximately the same time.
69
+ # If you're slicing manually or otherwise tuning automatic slicing, keep in mind that:
70
+ # * Query performance is most efficient when the number of slices is equal to the number of shards in the index or backing index. If that number is large (for example, 500), choose a lower number as too many slices hurts performance. Setting slices higher than the number of shards generally does not improve efficiency and adds overhead.
71
+ # * Update performance scales linearly across available resources with the number of slices.
72
+ # Whether query or update performance dominates the runtime depends on the documents being reindexed and cluster resources.
73
+ # **Update the document source**
74
+ # Update by query supports scripts to update the document source.
75
+ # As with the update API, you can set +ctx.op+ to change the operation that is performed.
76
+ # Set +ctx.op = "noop"+ if your script decides that it doesn't have to make any changes.
77
+ # The update by query operation skips updating the document and increments the +noop+ counter.
78
+ # Set +ctx.op = "delete"+ if your script decides that the document should be deleted.
79
+ # The update by query operation deletes the document and increments the +deleted+ counter.
80
+ # Update by query supports only +index+, +noop+, and +delete+.
81
+ # Setting +ctx.op+ to anything else is an error.
82
+ # Setting any other field in +ctx+ is an error.
83
+ # This API enables you to only modify the source of matching documents; you cannot move them.
27
84
  #
28
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search.
29
- # Supports wildcards (+*+).
85
+ # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search.
86
+ # It supports wildcards (+*+).
30
87
  # To search all data streams or indices, omit this parameter or use +*+ or +_all+. (*Required*)
31
88
  # @option arguments [Boolean] :allow_no_indices If +false+, the request returns an error if any wildcard expression, index alias, or +_all+ value targets only missing or closed indices.
32
89
  # This behavior applies even if the request targets other open indices.
33
90
  # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true.
34
- # @option arguments [String] :analyzer Analyzer to use for the query string.
91
+ # @option arguments [String] :analyzer The analyzer to use for the query string.
92
+ # This parameter can be used only when the +q+ query string parameter is specified.
35
93
  # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed.
36
- # @option arguments [String] :conflicts What to do if update by query hits version conflicts: +abort+ or +proceed+. Server default: abort.
37
- # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. Server default: OR.
38
- # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
39
- # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
94
+ # This parameter can be used only when the +q+ query string parameter is specified.
95
+ # @option arguments [String] :conflicts The preferred behavior when update by query hits version conflicts: +abort+ or +proceed+. Server default: abort.
96
+ # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+.
97
+ # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR.
98
+ # @option arguments [String] :df The field to use as default where no field prefix is given in the query string.
99
+ # This parameter can be used only when the +q+ query string parameter is specified.
100
+ # @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
40
101
  # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
41
- # Supports comma-separated values, such as +open,hidden+.
102
+ # It supports comma-separated values, such as +open,hidden+.
42
103
  # Valid values are: +all+, +open+, +closed+, +hidden+, +none+.
43
104
  # @option arguments [Integer] :from Starting offset (default: 0)
44
105
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
45
106
  # @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
46
- # @option arguments [Integer] :max_docs Maximum number of documents to process.
47
- # Defaults to all documents.
48
- # @option arguments [String] :pipeline ID of the pipeline to use to preprocess incoming documents.
107
+ # This parameter can be used only when the +q+ query string parameter is specified.
108
+ # @option arguments [Integer] :max_docs The maximum number of documents to process.
109
+ # It defaults to all documents.
110
+ # When set to a value less then or equal to +scroll_size+ then a scroll will not be used to retrieve the results for the operation.
111
+ # @option arguments [String] :pipeline The ID of the pipeline to use to preprocess incoming documents.
49
112
  # If the index has a default ingest pipeline specified, then setting the value to +_none+ disables the default ingest pipeline for this request.
50
113
  # If a final pipeline is configured it will always run, regardless of the value of this parameter.
51
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
52
- # Random by default.
53
- # @option arguments [String] :q Query in the Lucene query string syntax.
54
- # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes affected shards to make the operation visible to search.
114
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
115
+ # It is random by default.
116
+ # @option arguments [String] :q A query in the Lucene query string syntax.
117
+ # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes affected shards to make the operation visible to search after the request completes.
118
+ # This is different than the update API's +refresh+ parameter, which causes just the shard that received the request to be refreshed.
55
119
  # @option arguments [Boolean] :request_cache If +true+, the request cache is used for this request.
120
+ # It defaults to the index-level setting.
56
121
  # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. Server default: -1.
57
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
58
- # @option arguments [Time] :scroll Period to retain the search context for scrolling.
59
- # @option arguments [Integer] :scroll_size Size of the scroll request that powers the operation. Server default: 1000.
60
- # @option arguments [Time] :search_timeout Explicit timeout for each search request.
61
- # @option arguments [String] :search_type The type of the search operation. Available options: +query_then_fetch+, +dfs_query_then_fetch+.
122
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
123
+ # @option arguments [Time] :scroll The period to retain the search context for scrolling. Server default: 5m.
124
+ # @option arguments [Integer] :scroll_size The size of the scroll request that powers the operation. Server default: 1000.
125
+ # @option arguments [Time] :search_timeout An explicit timeout for each search request.
126
+ # By default, there is no timeout.
127
+ # @option arguments [String] :search_type The type of the search operation. Available options include +query_then_fetch+ and +dfs_query_then_fetch+.
62
128
  # @option arguments [Integer, String] :slices The number of slices this task should be divided into. Server default: 1.
63
129
  # @option arguments [Array<String>] :sort A comma-separated list of <field>:<direction> pairs.
64
- # @option arguments [Array<String>] :stats Specific +tag+ of the request for logging and statistical purposes.
65
- # @option arguments [Integer] :terminate_after Maximum number of documents to collect for each shard.
130
+ # @option arguments [Array<String>] :stats The specific +tag+ of the request for logging and statistical purposes.
131
+ # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard.
66
132
  # If a query reaches this limit, Elasticsearch terminates the query early.
67
- # Elasticsearch collects documents before sorting.
68
- # Use with caution.
133
+ # Elasticsearch collects documents before sorting.IMPORTANT: Use with caution.
69
134
  # Elasticsearch applies this parameter to each shard handling the request.
70
135
  # When possible, let Elasticsearch perform early termination automatically.
71
136
  # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
72
- # @option arguments [Time] :timeout Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards. Server default: 1m.
137
+ # @option arguments [Time] :timeout The period each update request waits for the following operations: dynamic mapping updates, waiting for active shards.
138
+ # By default, it is one minute.
139
+ # This guarantees Elasticsearch waits for at least the timeout before failing.
140
+ # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m.
73
141
  # @option arguments [Boolean] :version If +true+, returns the document version as part of a hit.
74
142
  # @option arguments [Boolean] :version_type Should the document increment the version number (internal) on hit or not (reindex)
75
143
  # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
76
- # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1.
77
- # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete. Server default: true.
144
+ # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
145
+ # The +timeout+ parameter controls how long each write request waits for unavailable shards to become available.
146
+ # Both work exactly the way they work in the bulk API. Server default: 1.
147
+ # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete.
148
+ # If +false+, Elasticsearch performs some preflight checks, launches the request, and returns a task ID that you can use to cancel or get the status of the task.
149
+ # Elasticsearch creates a record of this task as a document at +.tasks/task/${taskId}+. Server default: true.
78
150
  # @option arguments [Hash] :headers Custom HTTP headers
79
151
  # @option arguments [Hash] :body request body
80
152
  #
81
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html
153
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update-by-query
82
154
  #
83
155
  def update_by_query(arguments = {})
84
- request_opts = { endpoint: arguments[:endpoint] || "update_by_query" }
156
+ request_opts = { endpoint: arguments[:endpoint] || 'update_by_query' }
85
157
 
86
- defined_params = [:index].inject({}) do |set_variables, variable|
158
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
87
159
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
88
- set_variables
89
160
  end
90
161
  request_opts[:defined_params] = defined_params unless defined_params.empty?
91
162
 
@@ -53,32 +53,29 @@ module ElasticsearchServerless
53
53
  end
54
54
  end
55
55
 
56
- # Add new namespaces to this constant
57
- #
58
- API_NAMESPACES = [
59
- :async_search,
60
- :cat,
61
- :cluster,
62
- :connector,
63
- :enrich,
64
- :eql,
65
- :graph,
66
- :indices,
67
- :inference,
68
- :ingest,
69
- :license,
70
- :logstash,
71
- :machine_learning,
72
- :query_rules,
73
- :search_application,
74
- :security,
75
- :sql,
76
- :synonyms,
77
- :tasks,
78
- :transform
79
- ].freeze
80
- UPPERCASE_APIS = ['sql'].freeze
56
+ # New namespaces are added dynamically with the Generator
57
+ API_NAMESPACES = [:async_search,
58
+ :cat,
59
+ :cluster,
60
+ :connector,
61
+ :enrich,
62
+ :eql,
63
+ :graph,
64
+ :indices,
65
+ :inference,
66
+ :ingest,
67
+ :license,
68
+ :logstash,
69
+ :machine_learning,
70
+ :query_rules,
71
+ :search_application,
72
+ :security,
73
+ :sql,
74
+ :synonyms,
75
+ :tasks,
76
+ :transform].freeze
81
77
 
78
+ UPPERCASE_APIS = ['sql'].freeze
82
79
  API_NAMESPACES.each do |namespace|
83
80
  name = namespace.to_s
84
81
  module_name = if UPPERCASE_APIS.include?(name)
@@ -17,6 +17,6 @@
17
17
 
18
18
  module ElasticsearchServerless
19
19
  API_VERSION = '2023-10-31'.freeze
20
- CLIENT_VERSION = '0.6.0'.freeze
20
+ CLIENT_VERSION = '0.7.0'.freeze
21
21
  VERSION = CLIENT_VERSION
22
22
  end
@@ -26,6 +26,12 @@ module ElasticsearchServerless
26
26
  VALID_PARAMETERS = [:adapter, :log, :logger, :serializer_class, :trace, :tracer, :headers,
27
27
  :request_timeout, :retry_on_status, :retry_on_failure, :delay_on_retry,
28
28
  :opentelemetry_tracer_provider]
29
+ DEPRECATION_MESSAGE =
30
+ 'WARNING: Starting with the release of the Elastic Stack 9.0.0, this client ' \
31
+ 'will be discontinued.' \
32
+ 'Instead, you can use the latest version of the Elasticsearch Client to build your ' \
33
+ 'Elasticsearch Serverless Ruby applications: ' \
34
+ "https://github.com/elastic/elasticsearch-ruby\n".freeze
29
35
 
30
36
  # Initializes an Elasticsearch Serverless Client
31
37
  #
@@ -52,6 +58,7 @@ module ElasticsearchServerless
52
58
  validate_arguments(arguments)
53
59
  arguments.merge!(essential_parameters(url, api_key))
54
60
  @transport = Elastic::Transport::Client.new(arguments)
61
+ warn(DEPRECATION_MESSAGE)
55
62
  end
56
63
 
57
64
  def essential_parameters(url, api_key)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-serverless
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Briano
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-03 00:00:00.000000000 Z
10
+ date: 2025-03-12 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: elastic-transport
@@ -24,7 +23,6 @@ dependencies:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
25
  version: '8.3'
27
- description:
28
26
  email: support@elastic.co
29
27
  executables: []
30
28
  extensions: []
@@ -133,10 +131,16 @@ files:
133
131
  - lib/elasticsearch-serverless/api/indices/simulate_template.rb
134
132
  - lib/elasticsearch-serverless/api/indices/update_aliases.rb
135
133
  - lib/elasticsearch-serverless/api/indices/validate_query.rb
134
+ - lib/elasticsearch-serverless/api/inference/chat_completion_unified.rb
135
+ - lib/elasticsearch-serverless/api/inference/completion.rb
136
136
  - lib/elasticsearch-serverless/api/inference/delete.rb
137
137
  - lib/elasticsearch-serverless/api/inference/get.rb
138
138
  - lib/elasticsearch-serverless/api/inference/inference.rb
139
139
  - lib/elasticsearch-serverless/api/inference/put.rb
140
+ - lib/elasticsearch-serverless/api/inference/put_watsonx.rb
141
+ - lib/elasticsearch-serverless/api/inference/rerank.rb
142
+ - lib/elasticsearch-serverless/api/inference/sparse_embedding.rb
143
+ - lib/elasticsearch-serverless/api/inference/text_embedding.rb
140
144
  - lib/elasticsearch-serverless/api/info.rb
141
145
  - lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb
142
146
  - lib/elasticsearch-serverless/api/ingest/get_pipeline.rb
@@ -241,6 +245,8 @@ files:
241
245
  - lib/elasticsearch-serverless/api/security/invalidate_api_key.rb
242
246
  - lib/elasticsearch-serverless/api/security/put_role.rb
243
247
  - lib/elasticsearch-serverless/api/security/query_api_keys.rb
248
+ - lib/elasticsearch-serverless/api/security/query_role.rb
249
+ - lib/elasticsearch-serverless/api/security/update_api_key.rb
244
250
  - lib/elasticsearch-serverless/api/sql/clear_cursor.rb
245
251
  - lib/elasticsearch-serverless/api/sql/delete_async.rb
246
252
  - lib/elasticsearch-serverless/api/sql/get_async.rb
@@ -275,7 +281,12 @@ homepage: https://rubygems.org/gems/elasticsearch-serverless
275
281
  licenses:
276
282
  - Apache-2.0
277
283
  metadata: {}
278
- post_install_message:
284
+ post_install_message: |2+
285
+
286
+ WARNING: Starting with the release of the Elastic Stack 9.0.0, this client elasticsearch-serverless will be discontinued.
287
+ Instead, you can use the latest version of the Elasticsearch Client to build your Elasticsearch Serverless Ruby applications:
288
+ https://github.com/elastic/elasticsearch-ruby
289
+
279
290
  rdoc_options: []
280
291
  require_paths:
281
292
  - lib
@@ -290,8 +301,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
290
301
  - !ruby/object:Gem::Version
291
302
  version: '0'
292
303
  requirements: []
293
- rubygems_version: 3.5.20
294
- signing_key:
304
+ rubygems_version: 3.6.2
295
305
  specification_version: 4
296
306
  summary: Elasticsearch Serverless Client
297
307
  test_files: []
308
+ ...