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
@@ -22,31 +22,57 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Delete a document.
25
- # Removes a JSON document from the specified index.
25
+ # Remove a JSON document from the specified index.
26
+ # NOTE: You cannot send deletion requests directly to a data stream.
27
+ # To delete a document in a data stream, you must target the backing index containing the document.
28
+ # **Optimistic concurrency control**
29
+ # Delete operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the +if_seq_no+ and +if_primary_term+ parameters.
30
+ # If a mismatch is detected, the operation will result in a +VersionConflictException+ and a status code of +409+.
31
+ # **Versioning**
32
+ # Each document indexed is versioned.
33
+ # When deleting a document, the version can be specified to make sure the relevant document you are trying to delete is actually being deleted and it has not changed in the meantime.
34
+ # Every write operation run on a document, deletes included, causes its version to be incremented.
35
+ # The version number of a deleted document remains available for a short time after deletion to allow for control of concurrent operations.
36
+ # The length of time for which a deleted document's version remains available is determined by the +index.gc_deletes+ index setting.
37
+ # **Routing**
38
+ # If routing is used during indexing, the routing value also needs to be specified to delete a document.
39
+ # If the +_routing+ mapping is set to +required+ and no routing value is specified, the delete API throws a +RoutingMissingException+ and rejects the request.
40
+ # For example:
41
+ # +
42
+ # DELETE /my-index-000001/_doc/1?routing=shard-1
43
+ # +
44
+ # This request deletes the document with ID 1, but it is routed based on the user.
45
+ # The document is not deleted if the correct routing is not specified.
46
+ # **Distributed**
47
+ # The delete operation gets hashed into a specific shard ID.
48
+ # It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group.
26
49
  #
27
- # @option arguments [String] :id Unique identifier for the document. (*Required*)
28
- # @option arguments [String] :index Name of the target index. (*Required*)
50
+ # @option arguments [String] :id A unique identifier for the document. (*Required*)
51
+ # @option arguments [String] :index The name of the target index. (*Required*)
29
52
  # @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term.
30
53
  # @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number.
31
- # @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ do nothing with refreshes.
32
- # Valid values: +true+, +false+, +wait_for+. Server default: false.
33
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
34
- # @option arguments [Time] :timeout Period to wait for active shards. Server default: 1m.
35
- # @option arguments [Integer] :version Explicit version number for concurrency control.
36
- # The specified version must match the current version of the document for the request to succeed.
37
- # @option arguments [String] :version_type Specific version type: +external+, +external_gte+.
38
- # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
39
- # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1.
54
+ # @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search.
55
+ # If +wait_for+, it waits for a refresh to make this operation visible to search.
56
+ # If +false+, it does nothing with refreshes. Server default: false.
57
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
58
+ # @option arguments [Time] :timeout The period to wait for active shards.This parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs.
59
+ # Some reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation.
60
+ # By default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error. Server default: 1m.
61
+ # @option arguments [Integer] :version An explicit version number for concurrency control.
62
+ # It must match the current version of the document for the request to succeed.
63
+ # @option arguments [String] :version_type The version type.
64
+ # @option arguments [Integer, String] :wait_for_active_shards The minimum number of shard copies that must be active before proceeding with the operation.
65
+ # You can set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
66
+ # The default value of +1+ means it waits for each primary shard to be active. Server default: 1.
40
67
  # @option arguments [Hash] :headers Custom HTTP headers
41
68
  #
42
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html
69
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete
43
70
  #
44
71
  def delete(arguments = {})
45
- request_opts = { endpoint: arguments[:endpoint] || "delete" }
72
+ request_opts = { endpoint: arguments[:endpoint] || 'delete' }
46
73
 
47
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
74
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
48
75
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
49
- set_variables
50
76
  end
51
77
  request_opts[:defined_params] = defined_params unless defined_params.empty?
52
78
 
@@ -67,11 +93,11 @@ module ElasticsearchServerless
67
93
  params = Utils.process_params(arguments)
68
94
 
69
95
  if Array(arguments[:ignore]).include?(404)
70
- Utils.rescue_from_not_found {
96
+ Utils.rescue_from_not_found do
71
97
  ElasticsearchServerless::API::Response.new(
72
98
  perform_request(method, path, params, body, headers, request_opts)
73
99
  )
74
- }
100
+ end
75
101
  else
76
102
  ElasticsearchServerless::API::Response.new(
77
103
  perform_request(method, path, params, body, headers, request_opts)
@@ -23,66 +23,128 @@ module ElasticsearchServerless
23
23
  module Actions
24
24
  # Delete documents.
25
25
  # Deletes documents that match the specified query.
26
+ # If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:
27
+ # * +read+
28
+ # * +delete+ or +write+
29
+ # You can specify the query criteria in the request URI or the request body using the same syntax as the search API.
30
+ # When you submit a delete by query request, Elasticsearch gets a snapshot of the data stream or index when it begins processing the request and deletes matching documents using internal versioning.
31
+ # If a document changes between the time that the snapshot is taken and the delete operation is processed, it results in a version conflict and the delete operation fails.
32
+ # NOTE: Documents with a version equal to 0 cannot be deleted using delete by query because internal versioning does not support 0 as a valid version number.
33
+ # While processing a delete by query request, Elasticsearch performs multiple search requests sequentially to find all of the matching documents to delete.
34
+ # A bulk delete request is performed for each batch of matching documents.
35
+ # If a search or bulk request is rejected, the requests are retried up to 10 times, with exponential back off.
36
+ # If the maximum retry limit is reached, processing halts and all failed requests are returned in the response.
37
+ # Any delete requests that completed successfully still stick, they are not rolled back.
38
+ # You can opt to count version conflicts instead of halting and returning by setting +conflicts+ to +proceed+.
39
+ # Note that if you opt to count version conflicts the operation could attempt to delete more documents from the source than +max_docs+ until it has successfully deleted +max_docs documents+, or it has gone through every document in the source query.
40
+ # **Throttling delete requests**
41
+ # To control the rate at which delete by query issues batches of delete operations, you can set +requests_per_second+ to any positive decimal number.
42
+ # This pads each batch with a wait time to throttle the rate.
43
+ # Set +requests_per_second+ to +-1+ to disable throttling.
44
+ # 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.
45
+ # The padding time is the difference between the batch size divided by the +requests_per_second+ and the time spent writing.
46
+ # By default the batch size is +1000+, so if +requests_per_second+ is set to +500+:
47
+ # +
48
+ # target_time = 1000 / 500 per second = 2 seconds
49
+ # wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
50
+ # +
51
+ # 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.
52
+ # This is "bursty" instead of "smooth".
53
+ # **Slicing**
54
+ # Delete by query supports sliced scroll to parallelize the delete process.
55
+ # This can improve efficiency and provide a convenient way to break the request down into smaller parts.
56
+ # Setting +slices+ to +auto+ lets Elasticsearch choose the number of slices to use.
57
+ # This setting will use one slice per shard, up to a certain limit.
58
+ # 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.
59
+ # Adding slices to the delete by query operation creates sub-requests which means it has some quirks:
60
+ # * You can see these requests in the tasks APIs. These sub-requests are "child" tasks of the task for the request with slices.
61
+ # * Fetching the status of the task for the request with slices only contains the status of completed slices.
62
+ # * These sub-requests are individually addressable for things like cancellation and rethrottling.
63
+ # * Rethrottling the request with +slices+ will rethrottle the unfinished sub-request proportionally.
64
+ # * Canceling the request with +slices+ will cancel each sub-request.
65
+ # * 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.
66
+ # * Parameters like +requests_per_second+ and +max_docs+ on a request with +slices+ are distributed proportionally to each sub-request. Combine that with the earlier point about distribution being uneven and you should conclude that using +max_docs+ with +slices+ might not result in exactly +max_docs+ documents being deleted.
67
+ # * 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.
68
+ # If you're slicing manually or otherwise tuning automatic slicing, keep in mind that:
69
+ # * 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.
70
+ # * Delete performance scales linearly across available resources with the number of slices.
71
+ # Whether query or delete performance dominates the runtime depends on the documents being reindexed and cluster resources.
72
+ # **Cancel a delete by query operation**
73
+ # Any delete by query can be canceled using the task cancel API. For example:
74
+ # +
75
+ # POST _tasks/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel
76
+ # +
77
+ # The task ID can be found by using the get tasks API.
78
+ # Cancellation should happen quickly but might take a few seconds.
79
+ # The get task status API will continue to list the delete by query task until this task checks that it has been cancelled and terminates itself.
26
80
  #
27
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search.
28
- # Supports wildcards (+*+).
81
+ # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search.
82
+ # It supports wildcards (+*+).
29
83
  # To search all data streams or indices, omit this parameter or use +*+ or +_all+. (*Required*)
30
84
  # @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.
31
85
  # This behavior applies even if the request targets other open indices.
32
86
  # 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.
33
87
  # @option arguments [String] :analyzer Analyzer to use for the query string.
88
+ # This parameter can be used only when the +q+ query string parameter is specified.
34
89
  # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed.
90
+ # This parameter can be used only when the +q+ query string parameter is specified.
35
91
  # @option arguments [String] :conflicts What to do if delete by query hits version conflicts: +abort+ or +proceed+. Server default: abort.
36
- # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. Server default: OR.
37
- # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
38
- # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
92
+ # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+.
93
+ # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR.
94
+ # @option arguments [String] :df The field to use as default where no field prefix is given in the query string.
95
+ # This parameter can be used only when the +q+ query string parameter is specified.
96
+ # @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
39
97
  # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
40
- # Supports comma-separated values, such as +open,hidden+. Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open.
98
+ # It supports comma-separated values, such as +open,hidden+. Server default: open.
41
99
  # @option arguments [Integer] :from Starting offset (default: 0)
42
100
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
43
101
  # @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.
44
- # @option arguments [Integer] :max_docs Maximum number of documents to process.
102
+ # This parameter can be used only when the +q+ query string parameter is specified.
103
+ # @option arguments [Integer] :max_docs The maximum number of documents to process.
45
104
  # Defaults to all documents.
46
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
47
- # Random by default.
105
+ # When set to a value less then or equal to +scroll_size+, a scroll will not be used to retrieve the results for the operation.
106
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
107
+ # It is random by default.
48
108
  # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
109
+ # This is different than the delete API's +refresh+ parameter, which causes just the shard that received the delete request to be refreshed.
110
+ # Unlike the delete API, it does not support +wait_for+.
49
111
  # @option arguments [Boolean] :request_cache If +true+, the request cache is used for this request.
50
112
  # Defaults to the index-level setting.
51
- # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second.
52
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
53
- # @option arguments [String] :q Query in the Lucene query string syntax.
54
- # @option arguments [Time] :scroll Period to retain the search context for scrolling.
55
- # @option arguments [Integer] :scroll_size Size of the scroll request that powers the operation. Server default: 1000.
56
- # @option arguments [Time] :search_timeout Explicit timeout for each search request.
57
- # Defaults to no timeout.
113
+ # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. Server default: -1.
114
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
115
+ # @option arguments [String] :q A query in the Lucene query string syntax.
116
+ # @option arguments [Time] :scroll The period to retain the search context for scrolling.
117
+ # @option arguments [Integer] :scroll_size The size of the scroll request that powers the operation. Server default: 1000.
118
+ # @option arguments [Time] :search_timeout The explicit timeout for each search request.
119
+ # It defaults to no timeout.
58
120
  # @option arguments [String] :search_type The type of the search operation.
59
- # Available options: +query_then_fetch+, +dfs_query_then_fetch+.
121
+ # Available options include +query_then_fetch+ and +dfs_query_then_fetch+.
60
122
  # @option arguments [Integer, String] :slices The number of slices this task should be divided into. Server default: 1.
61
- # @option arguments [Array<String>] :sort A comma-separated list of <field>:<direction> pairs.
62
- # @option arguments [Array<String>] :stats Specific +tag+ of the request for logging and statistical purposes.
63
- # @option arguments [Integer] :terminate_after Maximum number of documents to collect for each shard.
123
+ # @option arguments [Array<String>] :sort A comma-separated list of +<field>:<direction>+ pairs.
124
+ # @option arguments [Array<String>] :stats The specific +tag+ of the request for logging and statistical purposes.
125
+ # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard.
64
126
  # If a query reaches this limit, Elasticsearch terminates the query early.
65
- # Elasticsearch collects documents before sorting.
66
- # Use with caution.
127
+ # Elasticsearch collects documents before sorting.Use with caution.
67
128
  # Elasticsearch applies this parameter to each shard handling the request.
68
129
  # When possible, let Elasticsearch perform early termination automatically.
69
130
  # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
70
- # @option arguments [Time] :timeout Period each deletion request waits for active shards. Server default: 1m.
131
+ # @option arguments [Time] :timeout The period each deletion request waits for active shards. Server default: 1m.
71
132
  # @option arguments [Boolean] :version If +true+, returns the document version as part of a hit.
72
133
  # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
73
- # Set to all or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1.
74
- # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete. Server default: true.
134
+ # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
135
+ # The +timeout+ value controls how long each write request waits for unavailable shards to become available. Server default: 1.
136
+ # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete.
137
+ # If +false+, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task. Elasticsearch creates a record of this task as a document at +.tasks/task/${taskId}+. When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space. Server default: true.
75
138
  # @option arguments [Hash] :headers Custom HTTP headers
76
139
  # @option arguments [Hash] :body request body
77
140
  #
78
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html
141
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query
79
142
  #
80
143
  def delete_by_query(arguments = {})
81
- request_opts = { endpoint: arguments[:endpoint] || "delete_by_query" }
144
+ request_opts = { endpoint: arguments[:endpoint] || 'delete_by_query' }
82
145
 
83
- defined_params = [:index].inject({}) do |set_variables, variable|
146
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
84
147
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
85
- set_variables
86
148
  end
87
149
  request_opts[:defined_params] = defined_params unless defined_params.empty?
88
150
 
@@ -24,21 +24,22 @@ module ElasticsearchServerless
24
24
  # Delete a script or search template.
25
25
  # Deletes a stored script or search template.
26
26
  #
27
- # @option arguments [String] :id Identifier for the stored script or search template. (*Required*)
28
- # @option arguments [Time] :master_timeout Period to wait for a connection to the master node.
29
- # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
30
- # @option arguments [Time] :timeout Period to wait for a response.
31
- # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
27
+ # @option arguments [String] :id The identifier for the stored script or search template. (*Required*)
28
+ # @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
29
+ # If no response is received before the timeout expires, the request fails and returns an error.
30
+ # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s.
31
+ # @option arguments [Time] :timeout The period to wait for a response.
32
+ # If no response is received before the timeout expires, the request fails and returns an error.
33
+ # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s.
32
34
  # @option arguments [Hash] :headers Custom HTTP headers
33
35
  #
34
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script
35
37
  #
36
38
  def delete_script(arguments = {})
37
- request_opts = { endpoint: arguments[:endpoint] || "delete_script" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'delete_script' }
38
40
 
39
- defined_params = [:id].inject({}) do |set_variables, variable|
41
+ defined_params = [:id].each_with_object({}) do |variable, set_variables|
40
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
- set_variables
42
43
  end
43
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
44
45
 
@@ -26,16 +26,16 @@ module ElasticsearchServerless
26
26
  # Deletes an existing enrich policy and its enrich index.
27
27
  #
28
28
  # @option arguments [String] :name Enrich policy to delete. (*Required*)
29
+ # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
29
30
  # @option arguments [Hash] :headers Custom HTTP headers
30
31
  #
31
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html
32
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-delete-policy
32
33
  #
33
34
  def delete_policy(arguments = {})
34
- request_opts = { endpoint: arguments[:endpoint] || "enrich.delete_policy" }
35
+ request_opts = { endpoint: arguments[:endpoint] || 'enrich.delete_policy' }
35
36
 
36
- defined_params = [:name].inject({}) do |set_variables, variable|
37
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
37
38
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
- set_variables
39
39
  end
40
40
  request_opts[:defined_params] = defined_params unless defined_params.empty?
41
41
 
@@ -50,7 +50,7 @@ module ElasticsearchServerless
50
50
 
51
51
  method = ElasticsearchServerless::API::HTTP_DELETE
52
52
  path = "_enrich/policy/#{Utils.listify(_name)}"
53
- params = {}
53
+ params = Utils.process_params(arguments)
54
54
 
55
55
  ElasticsearchServerless::API::Response.new(
56
56
  perform_request(method, path, params, body, headers, request_opts)
@@ -22,20 +22,21 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Enrich
24
24
  module Actions
25
- # Creates the enrich index for an existing enrich policy.
25
+ # Run an enrich policy.
26
+ # Create the enrich index for an existing enrich policy.
26
27
  #
27
28
  # @option arguments [String] :name Enrich policy to execute. (*Required*)
29
+ # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
28
30
  # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks other enrich policy execution requests until complete. Server default: true.
29
31
  # @option arguments [Hash] :headers Custom HTTP headers
30
32
  #
31
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html
33
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-execute-policy
32
34
  #
33
35
  def execute_policy(arguments = {})
34
- request_opts = { endpoint: arguments[:endpoint] || "enrich.execute_policy" }
36
+ request_opts = { endpoint: arguments[:endpoint] || 'enrich.execute_policy' }
35
37
 
36
- defined_params = [:name].inject({}) do |set_variables, variable|
38
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
37
39
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
- set_variables
39
40
  end
40
41
  request_opts[:defined_params] = defined_params unless defined_params.empty?
41
42
 
@@ -27,16 +27,16 @@ module ElasticsearchServerless
27
27
  #
28
28
  # @option arguments [String, Array<String>] :name Comma-separated list of enrich policy names used to limit the request.
29
29
  # To return information for all enrich policies, omit this parameter.
30
+ # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
30
31
  # @option arguments [Hash] :headers Custom HTTP headers
31
32
  #
32
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html
33
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-get-policy
33
34
  #
34
35
  def get_policy(arguments = {})
35
- request_opts = { endpoint: arguments[:endpoint] || "enrich.get_policy" }
36
+ request_opts = { endpoint: arguments[:endpoint] || 'enrich.get_policy' }
36
37
 
37
- defined_params = [:name].inject({}) do |set_variables, variable|
38
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
38
39
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
- set_variables
40
40
  end
41
41
  request_opts[:defined_params] = defined_params unless defined_params.empty?
42
42
 
@@ -51,9 +51,9 @@ module ElasticsearchServerless
51
51
  path = if _name
52
52
  "_enrich/policy/#{Utils.listify(_name)}"
53
53
  else
54
- "_enrich/policy"
54
+ '_enrich/policy'
55
55
  end
56
- params = {}
56
+ params = Utils.process_params(arguments)
57
57
 
58
58
  ElasticsearchServerless::API::Response.new(
59
59
  perform_request(method, path, params, body, headers, request_opts)
@@ -26,17 +26,17 @@ module ElasticsearchServerless
26
26
  # Creates an enrich policy.
27
27
  #
28
28
  # @option arguments [String] :name Name of the enrich policy to create or update. (*Required*)
29
+ # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
29
30
  # @option arguments [Hash] :headers Custom HTTP headers
30
31
  # @option arguments [Hash] :body request body
31
32
  #
32
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html
33
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-put-policy
33
34
  #
34
35
  def put_policy(arguments = {})
35
- request_opts = { endpoint: arguments[:endpoint] || "enrich.put_policy" }
36
+ request_opts = { endpoint: arguments[:endpoint] || 'enrich.put_policy' }
36
37
 
37
- defined_params = [:name].inject({}) do |set_variables, variable|
38
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
38
39
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
- set_variables
40
40
  end
41
41
  request_opts[:defined_params] = defined_params unless defined_params.empty?
42
42
 
@@ -52,7 +52,7 @@ module ElasticsearchServerless
52
52
 
53
53
  method = ElasticsearchServerless::API::HTTP_PUT
54
54
  path = "_enrich/policy/#{Utils.listify(_name)}"
55
- params = {}
55
+ params = Utils.process_params(arguments)
56
56
 
57
57
  ElasticsearchServerless::API::Response.new(
58
58
  perform_request(method, path, params, body, headers, request_opts)
@@ -22,7 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Eql
24
24
  module Actions
25
- # Deletes an async EQL search or a stored synchronous EQL search.
25
+ # Delete an async EQL search.
26
+ # Delete an async EQL search or a stored synchronous EQL search.
26
27
  # The API also deletes results for the search.
27
28
  #
28
29
  # @option arguments [String] :id Identifier for the search to delete.
@@ -30,14 +31,13 @@ module ElasticsearchServerless
30
31
  # A search ID is also provided if the request’s +keep_on_completion+ parameter is +true+. (*Required*)
31
32
  # @option arguments [Hash] :headers Custom HTTP headers
32
33
  #
33
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html
34
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-delete
34
35
  #
35
36
  def delete(arguments = {})
36
- request_opts = { endpoint: arguments[:endpoint] || "eql.delete" }
37
+ request_opts = { endpoint: arguments[:endpoint] || 'eql.delete' }
37
38
 
38
- defined_params = [:id].inject({}) do |set_variables, variable|
39
+ defined_params = [:id].each_with_object({}) do |variable, set_variables|
39
40
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
40
- set_variables
41
41
  end
42
42
  request_opts[:defined_params] = defined_params unless defined_params.empty?
43
43
 
@@ -22,7 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Eql
24
24
  module Actions
25
- # Returns the current status and available results for an async EQL search or a stored synchronous EQL search.
25
+ # Get async EQL search results.
26
+ # Get the current status and available results for an async EQL search or a stored synchronous EQL search.
26
27
  #
27
28
  # @option arguments [String] :id Identifier for the search. (*Required*)
28
29
  # @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster.
@@ -31,14 +32,13 @@ module ElasticsearchServerless
31
32
  # Defaults to no timeout, meaning the request waits for complete search results.
32
33
  # @option arguments [Hash] :headers Custom HTTP headers
33
34
  #
34
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-async-eql-search-api.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get
35
36
  #
36
37
  def get(arguments = {})
37
- request_opts = { endpoint: arguments[:endpoint] || "eql.get" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'eql.get' }
38
39
 
39
- defined_params = [:id].inject({}) do |set_variables, variable|
40
+ defined_params = [:id].each_with_object({}) do |variable, set_variables|
40
41
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
- set_variables
42
42
  end
43
43
  request_opts[:defined_params] = defined_params unless defined_params.empty?
44
44
 
@@ -22,19 +22,19 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Eql
24
24
  module Actions
25
- # Returns the current status for an async EQL search or a stored synchronous EQL search without returning results.
25
+ # Get the async EQL status.
26
+ # Get the current status for an async EQL search or a stored synchronous EQL search without returning results.
26
27
  #
27
28
  # @option arguments [String] :id Identifier for the search. (*Required*)
28
29
  # @option arguments [Hash] :headers Custom HTTP headers
29
30
  #
30
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-async-eql-status-api.html
31
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get-status
31
32
  #
32
33
  def get_status(arguments = {})
33
- request_opts = { endpoint: arguments[:endpoint] || "eql.get_status" }
34
+ request_opts = { endpoint: arguments[:endpoint] || 'eql.get_status' }
34
35
 
35
- defined_params = [:id].inject({}) do |set_variables, variable|
36
+ defined_params = [:id].each_with_object({}) do |variable, set_variables|
36
37
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
37
- set_variables
38
38
  end
39
39
  request_opts[:defined_params] = defined_params unless defined_params.empty?
40
40
 
@@ -22,10 +22,15 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Eql
24
24
  module Actions
25
- # Returns results matching a query expressed in Event Query Language (EQL)
25
+ # Get EQL search results.
26
+ # Returns search results for an Event Query Language (EQL) query.
27
+ # EQL assumes each document in a data stream or index corresponds to an event.
26
28
  #
27
29
  # @option arguments [String, Array] :index The name of the index to scope the operation (*Required*)
28
30
  # @option arguments [Boolean] :allow_no_indices [TODO] Server default: true.
31
+ # @option arguments [Boolean] :allow_partial_search_results If true, returns partial results if there are shard failures. If false, returns an error with no partial results. Server default: true.
32
+ # @option arguments [Boolean] :allow_partial_sequence_results If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all.
33
+ # This flag has effect only if allow_partial_search_results is true.
29
34
  # @option arguments [String, Array<String>] :expand_wildcards [TODO] Server default: open.
30
35
  # @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. Server default: true.
31
36
  # @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster. Server default: 5d.
@@ -34,14 +39,13 @@ module ElasticsearchServerless
34
39
  # @option arguments [Hash] :headers Custom HTTP headers
35
40
  # @option arguments [Hash] :body request body
36
41
  #
37
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html
42
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search
38
43
  #
39
44
  def search(arguments = {})
40
- request_opts = { endpoint: arguments[:endpoint] || "eql.search" }
45
+ request_opts = { endpoint: arguments[:endpoint] || 'eql.search' }
41
46
 
42
- defined_params = [:index].inject({}) do |set_variables, variable|
47
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
43
48
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
44
- set_variables
45
49
  end
46
50
  request_opts[:defined_params] = defined_params unless defined_params.empty?
47
51