elasticsearch-serverless 0.5.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 (250) 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 +11 -8
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +6 -10
  6. data/lib/elasticsearch-serverless/api/bulk.rb +109 -22
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +17 -18
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +17 -16
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +13 -18
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +5 -19
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +10 -15
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +7 -17
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +6 -16
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +6 -16
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +7 -16
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +6 -16
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +9 -7
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +8 -4
  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 +16 -13
  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 -8
  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 -6
  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 -11
  106. data/lib/elasticsearch-serverless/api/inference/get.rb +4 -9
  107. data/lib/elasticsearch-serverless/api/inference/inference.rb +0 -4
  108. data/lib/elasticsearch-serverless/api/inference/put.rb +12 -9
  109. data/lib/elasticsearch-serverless/api/inference/put_watsonx.rb +78 -0
  110. data/lib/elasticsearch-serverless/api/inference/rerank.rb +62 -0
  111. data/lib/elasticsearch-serverless/api/inference/sparse_embedding.rb +62 -0
  112. data/lib/elasticsearch-serverless/api/inference/text_embedding.rb +62 -0
  113. data/lib/elasticsearch-serverless/api/info.rb +4 -4
  114. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +5 -5
  115. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +6 -6
  116. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +5 -4
  117. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +3 -4
  118. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +9 -8
  119. data/lib/elasticsearch-serverless/api/license/get.rb +4 -5
  120. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +7 -6
  121. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +7 -7
  122. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +7 -6
  123. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +3 -4
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +4 -5
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +3 -4
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +3 -4
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +3 -4
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +3 -4
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +3 -4
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +3 -4
  131. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +4 -4
  132. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +3 -4
  133. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +5 -5
  134. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +3 -3
  135. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +3 -4
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +3 -4
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +4 -5
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +4 -5
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +4 -5
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +4 -5
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +4 -5
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +4 -5
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +4 -5
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +4 -5
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +3 -4
  146. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +4 -5
  147. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +4 -5
  148. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +3 -9
  149. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +3 -4
  150. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +3 -4
  151. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +5 -6
  152. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +4 -5
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +3 -4
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +3 -4
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +6 -4
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +6 -6
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +3 -4
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +16 -5
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +3 -4
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +3 -4
  161. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +3 -4
  162. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +3 -4
  163. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +3 -4
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +3 -4
  165. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +3 -4
  166. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +7 -6
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +3 -4
  168. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +3 -4
  169. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +3 -4
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +3 -4
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +3 -4
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +3 -4
  173. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +3 -4
  174. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +3 -4
  175. data/lib/elasticsearch-serverless/api/mget.rb +12 -5
  176. data/lib/elasticsearch-serverless/api/msearch.rb +16 -17
  177. data/lib/elasticsearch-serverless/api/msearch_template.rb +23 -16
  178. data/lib/elasticsearch-serverless/api/mtermvectors.rb +15 -12
  179. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +33 -11
  180. data/lib/elasticsearch-serverless/api/ping.rb +8 -10
  181. data/lib/elasticsearch-serverless/api/put_script.rb +12 -11
  182. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +6 -5
  183. data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +6 -5
  184. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +5 -5
  185. data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +5 -5
  186. data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +7 -6
  187. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +11 -7
  188. data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +11 -6
  189. data/lib/elasticsearch-serverless/api/query_rules/test.rb +5 -5
  190. data/lib/elasticsearch-serverless/api/rank_eval.rb +8 -7
  191. data/lib/elasticsearch-serverless/api/reindex.rb +146 -9
  192. data/lib/elasticsearch-serverless/api/render_search_template.rb +7 -7
  193. data/lib/elasticsearch-serverless/api/response.rb +1 -1
  194. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +7 -3
  195. data/lib/elasticsearch-serverless/api/scroll.rb +4 -4
  196. data/lib/elasticsearch-serverless/api/search.rb +79 -72
  197. data/lib/elasticsearch-serverless/api/search_application/delete.rb +4 -5
  198. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +3 -4
  199. data/lib/elasticsearch-serverless/api/search_application/get.rb +3 -4
  200. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +4 -5
  201. data/lib/elasticsearch-serverless/api/search_application/list.rb +5 -4
  202. data/lib/elasticsearch-serverless/api/search_application/put.rb +3 -4
  203. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +3 -4
  204. data/lib/elasticsearch-serverless/api/search_application/search.rb +3 -4
  205. data/lib/elasticsearch-serverless/api/search_mvt.rb +132 -10
  206. data/lib/elasticsearch-serverless/api/search_template.rb +13 -13
  207. data/lib/elasticsearch-serverless/api/security/authenticate.rb +3 -3
  208. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +7 -3
  209. data/lib/elasticsearch-serverless/api/security/delete_role.rb +6 -5
  210. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +3 -3
  211. data/lib/elasticsearch-serverless/api/security/get_builtin_privileges.rb +3 -3
  212. data/lib/elasticsearch-serverless/api/security/get_role.rb +11 -8
  213. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +6 -5
  214. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +8 -6
  215. data/lib/elasticsearch-serverless/api/security/put_role.rb +3 -4
  216. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +12 -6
  217. data/lib/elasticsearch-serverless/api/security/query_role.rb +61 -0
  218. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +74 -0
  219. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +4 -4
  220. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +10 -6
  221. data/lib/elasticsearch-serverless/api/sql/get_async.rb +16 -13
  222. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +6 -6
  223. data/lib/elasticsearch-serverless/api/sql/query.rb +8 -5
  224. data/lib/elasticsearch-serverless/api/sql/translate.rb +6 -4
  225. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +17 -6
  226. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +7 -7
  227. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +7 -8
  228. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +7 -7
  229. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +7 -6
  230. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -6
  231. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -7
  232. data/lib/elasticsearch-serverless/api/tasks/get.rb +9 -7
  233. data/lib/elasticsearch-serverless/api/terms_enum.rb +7 -9
  234. data/lib/elasticsearch-serverless/api/termvectors.rb +40 -17
  235. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +3 -5
  236. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +5 -6
  237. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +4 -5
  238. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +4 -5
  239. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +3 -4
  240. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +4 -5
  241. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +7 -8
  242. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +3 -5
  243. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +3 -4
  244. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +3 -4
  245. data/lib/elasticsearch-serverless/api/update.rb +36 -24
  246. data/lib/elasticsearch-serverless/api/update_by_query.rb +102 -31
  247. data/lib/elasticsearch-serverless/api.rb +22 -25
  248. data/lib/elasticsearch-serverless/version.rb +1 -1
  249. data/lib/elasticsearch-serverless.rb +7 -0
  250. metadata +18 -7
@@ -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
 
@@ -22,35 +22,54 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Check a document.
25
- # Checks if a specified document exists.
25
+ # Verify that a document exists.
26
+ # For example, check to see if a document with the +_id+ 0 exists:
27
+ # +
28
+ # HEAD my-index-000001/_doc/0
29
+ # +
30
+ # If the document exists, the API returns a status code of +200 - OK+.
31
+ # If the document doesn’t exist, the API returns +404 - Not Found+.
32
+ # **Versioning support**
33
+ # You can use the +version+ parameter to check the document only if its current version is equal to the specified one.
34
+ # Internally, Elasticsearch has marked the old document as deleted and added an entirely new document.
35
+ # The old version of the document doesn't disappear immediately, although you won't be able to access it.
36
+ # Elasticsearch cleans up deleted documents in the background as you continue to index more data.
26
37
  #
27
- # @option arguments [String] :id Identifier of the document. (*Required*)
28
- # @option arguments [String] :index Comma-separated list of data streams, indices, and aliases.
29
- # Supports wildcards (+*+). (*Required*)
30
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
31
- # Random by default.
38
+ # @option arguments [String] :id A unique document identifier. (*Required*)
39
+ # @option arguments [String] :index A comma-separated list of data streams, indices, and aliases.
40
+ # It supports wildcards (+*+). (*Required*)
41
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
42
+ # By default, the operation is randomized between the shard replicas.If it is set to +_local+, the operation will prefer to be run on a local allocated shard when possible.
43
+ # If it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value.
44
+ # This can help with "jumping values" when hitting different shards in different refresh states.
45
+ # A sample value can be something like the web session ID or the user name.
32
46
  # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true.
33
- # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
34
- # @option arguments [String] :routing Target the specified primary shard.
35
- # @option arguments [Boolean, String, Array<String>] :_source +true+ or +false+ to return the +_source+ field or not, or a list of fields to return.
36
- # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
47
+ # @option arguments [Boolean] :refresh If +true+, the request refreshes the relevant shards before retrieving the document.
48
+ # Setting it to +true+ should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
49
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
50
+ # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or lists the fields to return.
51
+ # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
52
+ # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter.
53
+ # If the +_source+ parameter is +false+, this parameter is ignored.
37
54
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
38
- # @option arguments [String, Array<String>] :stored_fields List of stored fields to return as part of a hit.
55
+ # If this parameter is specified, only these source fields are returned.
56
+ # You can exclude fields from this subset using the +_source_excludes+ query parameter.
57
+ # If the +_source+ parameter is +false+, this parameter is ignored.
58
+ # @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return as part of a hit.
39
59
  # If no fields are specified, no stored fields are included in the response.
40
- # If this field is specified, the +_source+ parameter defaults to false.
60
+ # If this field is specified, the +_source+ parameter defaults to +false+.
41
61
  # @option arguments [Integer] :version Explicit version number for concurrency control.
42
62
  # The specified version must match the current version of the document for the request to succeed.
43
- # @option arguments [String] :version_type Specific version type: +external+, +external_gte+.
63
+ # @option arguments [String] :version_type The version type.
44
64
  # @option arguments [Hash] :headers Custom HTTP headers
45
65
  #
46
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
66
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get
47
67
  #
48
68
  def exists(arguments = {})
49
- request_opts = { endpoint: arguments[:endpoint] || "exists" }
69
+ request_opts = { endpoint: arguments[:endpoint] || 'exists' }
50
70
 
51
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
71
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
52
72
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
53
- set_variables
54
73
  end
55
74
  request_opts[:defined_params] = defined_params unless defined_params.empty?
56
75
 
@@ -71,11 +90,11 @@ module ElasticsearchServerless
71
90
  params = Utils.process_params(arguments)
72
91
 
73
92
  Utils.rescue_from_not_found do
74
- perform_request(method, path, params, body, headers, request_opts).status == 200 ? true : false
93
+ perform_request(method, path, params, body, headers, request_opts).status == 200
75
94
  end
76
95
  end
77
96
 
78
- alias_method :exists?, :exists
97
+ alias exists? exists
79
98
  end
80
99
  end
81
100
  end
@@ -22,32 +22,37 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Check for a document source.
25
- # Checks if a document's +_source+ is stored.
25
+ # Check whether a document source exists in an index.
26
+ # For example:
27
+ # +
28
+ # HEAD my-index-000001/_source/1
29
+ # +
30
+ # A document's source is not available if it is disabled in the mapping.
26
31
  #
27
- # @option arguments [String] :id Identifier of the document. (*Required*)
28
- # @option arguments [String] :index Comma-separated list of data streams, indices, and aliases.
29
- # Supports wildcards (+*+). (*Required*)
30
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
31
- # Random by default.
32
- # @option arguments [Boolean] :realtime If true, the request is real-time as opposed to near-real-time. Server default: true.
33
- # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
34
- # @option arguments [String] :routing Target the specified primary shard.
35
- # @option arguments [Boolean, String, Array<String>] :_source +true+ or +false+ to return the +_source+ field or not, or a list of fields to return.
32
+ # @option arguments [String] :id A unique identifier for the document. (*Required*)
33
+ # @option arguments [String] :index A comma-separated list of data streams, indices, and aliases.
34
+ # It supports wildcards (+*+). (*Required*)
35
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
36
+ # By default, the operation is randomized between the shard replicas.
37
+ # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true.
38
+ # @option arguments [Boolean] :refresh If +true+, the request refreshes the relevant shards before retrieving the document.
39
+ # Setting it to +true+ should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
40
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
41
+ # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or lists the fields to return.
36
42
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
37
43
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
38
- # @option arguments [Integer] :version Explicit version number for concurrency control.
39
- # The specified version must match the current version of the document for the request to succeed.
40
- # @option arguments [String] :version_type Specific version type: +external+, +external_gte+.
44
+ # @option arguments [Integer] :version The version number for concurrency control.
45
+ # It must match the current version of the document for the request to succeed.
46
+ # @option arguments [String] :version_type The version type.
41
47
  # @option arguments [Hash] :headers Custom HTTP headers
42
48
  #
43
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
49
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get
44
50
  #
45
51
  def exists_source(arguments = {})
46
- request_opts = { endpoint: arguments[:endpoint] || "exists_source" }
52
+ request_opts = { endpoint: arguments[:endpoint] || 'exists_source' }
47
53
 
48
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
54
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
49
55
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
50
- set_variables
51
56
  end
52
57
  request_opts[:defined_params] = defined_params unless defined_params.empty?
53
58
 
@@ -72,7 +77,7 @@ module ElasticsearchServerless
72
77
  )
73
78
  end
74
79
 
75
- alias_method :exists_source?, :exists_source
80
+ alias exists_source? exists_source
76
81
  end
77
82
  end
78
83
  end
@@ -22,36 +22,45 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Explain a document match result.
25
- # Returns information about why a specific document matches, or doesnt match, a query.
25
+ # Get information about why a specific document matches, or doesn't match, a query.
26
+ # It computes a score explanation for a query and a specific document.
26
27
  #
27
- # @option arguments [String] :id Defines the document ID. (*Required*)
28
- # @option arguments [String] :index Index names used to limit the request.
28
+ # @option arguments [String] :id The document identifier. (*Required*)
29
+ # @option arguments [String] :index Index names that are used to limit the request.
29
30
  # Only a single index name can be provided to this parameter. (*Required*)
30
- # @option arguments [String] :analyzer Analyzer to use for the query string.
31
- # This parameter can only be used when the +q+ query string parameter is specified.
31
+ # @option arguments [String] :analyzer The analyzer to use for the query string.
32
+ # This parameter can be used only when the +q+ query string parameter is specified.
32
33
  # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed.
33
- # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. Server default: OR.
34
- # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
34
+ # This parameter can be used only when the +q+ query string parameter is specified.
35
+ # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+.
36
+ # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR.
37
+ # @option arguments [String] :df The field to use as default where no field prefix is given in the query string.
38
+ # This parameter can be used only when the +q+ query string parameter is specified.
35
39
  # @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.
36
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
37
- # Random by default.
38
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
39
- # @option arguments [Boolean, String, Array<String>] :_source True or false to return the +_source+ field or not, or a list of fields to return.
40
+ # This parameter can be used only when the +q+ query string parameter is specified.
41
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
42
+ # It is random by default.
43
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
44
+ # @option arguments [Boolean, String, Array<String>] :_source +True+ or +false+ to return the +_source+ field or not or a list of fields to return.
40
45
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
46
+ # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter.
47
+ # If the +_source+ parameter is +false+, this parameter is ignored.
41
48
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
49
+ # If this parameter is specified, only these source fields are returned.
50
+ # You can exclude fields from this subset using the +_source_excludes+ query parameter.
51
+ # If the +_source+ parameter is +false+, this parameter is ignored.
42
52
  # @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return in the response.
43
- # @option arguments [String] :q Query in the Lucene query string syntax.
53
+ # @option arguments [String] :q The query in the Lucene query string syntax.
44
54
  # @option arguments [Hash] :headers Custom HTTP headers
45
55
  # @option arguments [Hash] :body request body
46
56
  #
47
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html
57
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-explain
48
58
  #
49
59
  def explain(arguments = {})
50
- request_opts = { endpoint: arguments[:endpoint] || "explain" }
60
+ request_opts = { endpoint: arguments[:endpoint] || 'explain' }
51
61
 
52
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
62
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
53
63
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
54
- set_variables
55
64
  end
56
65
  request_opts[:defined_params] = defined_params unless defined_params.empty?
57
66
 
@@ -21,32 +21,35 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # The field capabilities API returns the information about the capabilities of fields among multiple indices.
25
- # The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type
26
- # of keyword is returned as any other field that belongs to the +keyword+ family.
24
+ # Get the field capabilities.
25
+ # Get information about the capabilities of fields among multiple indices.
26
+ # For data streams, the API returns field capabilities among the stream’s backing indices.
27
+ # It returns runtime fields like any other field.
28
+ # For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the +keyword+ family.
27
29
  #
28
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.
30
+ # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all.
29
31
  # @option arguments [Boolean] :allow_no_indices If false, the request returns an error if any wildcard expression, index alias,
30
32
  # or +_all+ value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request
31
33
  # targeting +foo*,bar*+ returns an error if an index starts with foo but no index starts with bar. Server default: true.
32
- # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as +open,hidden+. Server default: open.
33
- # @option arguments [String, Array<String>] :fields Comma-separated list of fields to retrieve capabilities for. Wildcard (+*+) expressions are supported.
34
+ # @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as +open,hidden+. Server default: open.
35
+ # @option arguments [String, Array<String>] :fields A comma-separated list of fields to retrieve capabilities for. Wildcard (+*+) expressions are supported.
34
36
  # @option arguments [Boolean] :ignore_unavailable If +true+, missing or closed indices are not included in the response.
35
37
  # @option arguments [Boolean] :include_unmapped If true, unmapped fields are included in the response.
36
- # @option arguments [String] :filters An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent
37
- # @option arguments [Array<String>] :types Only return results for fields that have one of the types in the list
38
+ # @option arguments [String] :filters A comma-separated list of filters to apply to the response.
39
+ # @option arguments [Array<String>] :types A comma-separated list of field types to include.
40
+ # Any fields that do not match one of these types will be excluded from the results.
41
+ # It defaults to empty, meaning that all field types are returned.
38
42
  # @option arguments [Boolean] :include_empty_fields If false, empty fields are not included in the response. Server default: true.
39
43
  # @option arguments [Hash] :headers Custom HTTP headers
40
44
  # @option arguments [Hash] :body request body
41
45
  #
42
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html
46
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-field-caps
43
47
  #
44
48
  def field_caps(arguments = {})
45
- request_opts = { endpoint: arguments[:endpoint] || "field_caps" }
49
+ request_opts = { endpoint: arguments[:endpoint] || 'field_caps' }
46
50
 
47
- defined_params = [:index].inject({}) do |set_variables, variable|
51
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
48
52
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
49
- set_variables
50
53
  end
51
54
  request_opts[:defined_params] = defined_params unless defined_params.empty?
52
55
 
@@ -66,7 +69,7 @@ module ElasticsearchServerless
66
69
  path = if _index
67
70
  "#{Utils.listify(_index)}/_field_caps"
68
71
  else
69
- "_field_caps"
72
+ '_field_caps'
70
73
  end
71
74
  params = Utils.process_params(arguments)
72
75
 
@@ -22,35 +22,85 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Get a document by its ID.
25
- # Retrieves the document with the specified ID from an index.
25
+ # Get a document and its source or stored fields from an index.
26
+ # By default, this API is realtime and is not affected by the refresh rate of the index (when data will become visible for search).
27
+ # In the case where stored fields are requested with the +stored_fields+ parameter and the document has been updated but is not yet refreshed, the API will have to parse and analyze the source to extract the stored fields.
28
+ # To turn off realtime behavior, set the +realtime+ parameter to false.
29
+ # **Source filtering**
30
+ # By default, the API returns the contents of the +_source+ field unless you have used the +stored_fields+ parameter or the +_source+ field is turned off.
31
+ # You can turn off +_source+ retrieval by using the +_source+ parameter:
32
+ # +
33
+ # GET my-index-000001/_doc/0?_source=false
34
+ # +
35
+ # If you only need one or two fields from the +_source+, use the +_source_includes+ or +_source_excludes+ parameters to include or filter out particular fields.
36
+ # This can be helpful with large documents where partial retrieval can save on network overhead
37
+ # Both parameters take a comma separated list of fields or wildcard expressions.
38
+ # For example:
39
+ # +
40
+ # GET my-index-000001/_doc/0?_source_includes=*.id&_source_excludes=entities
41
+ # +
42
+ # If you only want to specify includes, you can use a shorter notation:
43
+ # +
44
+ # GET my-index-000001/_doc/0?_source=*.id
45
+ # +
46
+ # **Routing**
47
+ # If routing is used during indexing, the routing value also needs to be specified to retrieve a document.
48
+ # For example:
49
+ # +
50
+ # GET my-index-000001/_doc/2?routing=user1
51
+ # +
52
+ # This request gets the document with ID 2, but it is routed based on the user.
53
+ # The document is not fetched if the correct routing is not specified.
54
+ # **Distributed**
55
+ # The GET operation is hashed into a specific shard ID.
56
+ # It is then redirected to one of the replicas within that shard ID and returns the result.
57
+ # The replicas are the primary shard and its replicas within that shard ID group.
58
+ # This means that the more replicas you have, the better your GET scaling will be.
59
+ # **Versioning support**
60
+ # You can use the +version+ parameter to retrieve the document only if its current version is equal to the specified one.
61
+ # Internally, Elasticsearch has marked the old document as deleted and added an entirely new document.
62
+ # The old version of the document doesn't disappear immediately, although you won't be able to access it.
63
+ # Elasticsearch cleans up deleted documents in the background as you continue to index more data.
26
64
  #
27
- # @option arguments [String] :id Unique identifier of the document. (*Required*)
28
- # @option arguments [String] :index Name of the index that contains the document. (*Required*)
29
- # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source?
30
- # Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance.
31
- # Fetches with this enabled will be slower the enabling synthetic source natively in the index.
32
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
65
+ # @option arguments [String] :id A unique document identifier. (*Required*)
66
+ # @option arguments [String] :index The name of the index that contains the document. (*Required*)
67
+ # @option arguments [Boolean] :force_synthetic_source Indicates whether the request forces synthetic +_source+.
68
+ # Use this paramater to test if the mapping supports synthetic +_source+ and to get a sense of the worst case performance.
69
+ # Fetches with this parameter enabled will be slower than enabling synthetic source natively in the index.
70
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
71
+ # By default, the operation is randomized between the shard replicas.If it is set to +_local+, the operation will prefer to be run on a local allocated shard when possible.
72
+ # If it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value.
73
+ # This can help with "jumping values" when hitting different shards in different refresh states.
74
+ # A sample value can be something like the web session ID or the user name.
33
75
  # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true.
34
- # @option arguments [Boolean] :refresh If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.
35
- # @option arguments [String] :routing Target the specified primary shard.
36
- # @option arguments [Boolean, String, Array<String>] :_source True or false to return the _source field or not, or a list of fields to return.
37
- # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
76
+ # @option arguments [Boolean] :refresh If +true+, the request refreshes the relevant shards before retrieving the document.
77
+ # Setting it to +true+ should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
78
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
79
+ # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or lists the fields to return.
80
+ # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
81
+ # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter.
82
+ # If the +_source+ parameter is +false+, this parameter is ignored.
38
83
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
39
- # @option arguments [String, Array<String>] :stored_fields List of stored fields to return as part of a hit.
84
+ # If this parameter is specified, only these source fields are returned.
85
+ # You can exclude fields from this subset using the +_source_excludes+ query parameter.
86
+ # If the +_source+ parameter is +false+, this parameter is ignored.
87
+ # @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return as part of a hit.
40
88
  # If no fields are specified, no stored fields are included in the response.
41
- # If this field is specified, the +_source+ parameter defaults to false.
42
- # @option arguments [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
43
- # @option arguments [String] :version_type Specific version type: internal, external, external_gte.
89
+ # If this field is specified, the +_source+ parameter defaults to +false+.
90
+ # Only leaf fields can be retrieved with the +stored_field+ option.
91
+ # Object fields can't be returned;​if specified, the request fails.
92
+ # @option arguments [Integer] :version The version number for concurrency control.
93
+ # It must match the current version of the document for the request to succeed.
94
+ # @option arguments [String] :version_type The version type.
44
95
  # @option arguments [Hash] :headers Custom HTTP headers
45
96
  #
46
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
97
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get
47
98
  #
48
99
  def get(arguments = {})
49
- request_opts = { endpoint: arguments[:endpoint] || "get" }
100
+ request_opts = { endpoint: arguments[:endpoint] || 'get' }
50
101
 
51
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
102
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
52
103
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
53
- set_variables
54
104
  end
55
105
  request_opts[:defined_params] = defined_params unless defined_params.empty?
56
106
 
@@ -71,11 +121,11 @@ module ElasticsearchServerless
71
121
  params = Utils.process_params(arguments)
72
122
 
73
123
  if Array(arguments[:ignore]).include?(404)
74
- Utils.rescue_from_not_found {
124
+ Utils.rescue_from_not_found do
75
125
  ElasticsearchServerless::API::Response.new(
76
126
  perform_request(method, path, params, body, headers, request_opts)
77
127
  )
78
- }
128
+ end
79
129
  else
80
130
  ElasticsearchServerless::API::Response.new(
81
131
  perform_request(method, path, params, body, headers, request_opts)
@@ -24,18 +24,19 @@ module ElasticsearchServerless
24
24
  # Get a script or search template.
25
25
  # Retrieves 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 Specify timeout for connection to master
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 the master node.
29
+ # If the master node is not available 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: .
29
31
  # @option arguments [Hash] :headers Custom HTTP headers
30
32
  #
31
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html
33
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script
32
34
  #
33
35
  def get_script(arguments = {})
34
- request_opts = { endpoint: arguments[:endpoint] || "get_script" }
36
+ request_opts = { endpoint: arguments[:endpoint] || 'get_script' }
35
37
 
36
- defined_params = [:id].inject({}) do |set_variables, variable|
38
+ defined_params = [:id].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
 
@@ -22,30 +22,40 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Get a document's source.
25
- # Returns the source of a document.
25
+ # Get the source of a document.
26
+ # For example:
27
+ # +
28
+ # GET my-index-000001/_source/1
29
+ # +
30
+ # You can use the source filtering parameters to control which parts of the +_source+ are returned:
31
+ # +
32
+ # GET my-index-000001/_source/1/?_source_includes=*.id&_source_excludes=entities
33
+ # +
26
34
  #
27
- # @option arguments [String] :id Unique identifier of the document. (*Required*)
28
- # @option arguments [String] :index Name of the index that contains the document. (*Required*)
29
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
30
- # @option arguments [Boolean] :realtime Boolean) If true, the request is real-time as opposed to near-real-time. Server default: true.
31
- # @option arguments [Boolean] :refresh If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes.
32
- # @option arguments [String] :routing Target the specified primary shard.
33
- # @option arguments [Boolean, String, Array<String>] :_source True or false to return the _source field or not, or a list of fields to return.
35
+ # @option arguments [String] :id A unique document identifier. (*Required*)
36
+ # @option arguments [String] :index The name of the index that contains the document. (*Required*)
37
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
38
+ # By default, the operation is randomized between the shard replicas.
39
+ # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true.
40
+ # @option arguments [Boolean] :refresh If +true+, the request refreshes the relevant shards before retrieving the document.
41
+ # Setting it to +true+ should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
42
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
43
+ # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or lists the fields to return.
34
44
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
35
45
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
36
- # @option arguments [String, Array<String>] :stored_fields [TODO]
37
- # @option arguments [Integer] :version Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
38
- # @option arguments [String] :version_type Specific version type: internal, external, external_gte.
46
+ # @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return as part of a hit.
47
+ # @option arguments [Integer] :version The version number for concurrency control.
48
+ # It must match the current version of the document for the request to succeed.
49
+ # @option arguments [String] :version_type The version type.
39
50
  # @option arguments [Hash] :headers Custom HTTP headers
40
51
  #
41
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
52
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get
42
53
  #
43
54
  def get_source(arguments = {})
44
- request_opts = { endpoint: arguments[:endpoint] || "get_source" }
55
+ request_opts = { endpoint: arguments[:endpoint] || 'get_source' }
45
56
 
46
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
57
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
47
58
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
48
- set_variables
49
59
  end
50
60
  request_opts[:defined_params] = defined_params unless defined_params.empty?
51
61
 
@@ -22,7 +22,12 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Graph
24
24
  module Actions
25
- # Extracts and summarizes information about the documents and terms in an Elasticsearch data stream or index.
25
+ # Explore graph analytics.
26
+ # Extract and summarize information about the documents and terms in an Elasticsearch data stream or index.
27
+ # The easiest way to understand the behavior of this API is to use the Graph UI to explore connections.
28
+ # An initial request to the +_explore+ API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph.
29
+ # Subsequent requests enable you to spider out from one more vertices of interest.
30
+ # You can exclude vertices that have already been returned.
26
31
  #
27
32
  # @option arguments [String, Array] :index Name of the index. (*Required*)
28
33
  # @option arguments [String] :routing Custom value used to route operations to a specific shard.
@@ -32,14 +37,13 @@ module ElasticsearchServerless
32
37
  # @option arguments [Hash] :headers Custom HTTP headers
33
38
  # @option arguments [Hash] :body request body
34
39
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html
40
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-graph
36
41
  #
37
42
  def explore(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "graph.explore" }
43
+ request_opts = { endpoint: arguments[:endpoint] || 'graph.explore' }
39
44
 
40
- defined_params = [:index].inject({}) do |set_variables, variable|
45
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
41
46
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
42
- set_variables
43
47
  end
44
48
  request_opts[:defined_params] = defined_params unless defined_params.empty?
45
49