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
@@ -25,98 +25,107 @@ module ElasticsearchServerless
25
25
  # Get search hits that match the query defined in the request.
26
26
  # You can provide search queries using the +q+ query string parameter or the request body.
27
27
  # If both are specified, only the query parameter is used.
28
+ # If the Elasticsearch security features are enabled, you must have the read index privilege for the target data stream, index, or alias. For cross-cluster search, refer to the documentation about configuring CCS privileges.
29
+ # To search a point in time (PIT) for an alias, you must have the +read+ index privilege for the alias's data streams or indices.
30
+ # **Search slicing**
31
+ # When paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently with the +slice+ and +pit+ properties.
32
+ # By default the splitting is done first on the shards, then locally on each shard.
33
+ # The local splitting partitions the shard into contiguous ranges based on Lucene document IDs.
34
+ # For instance if the number of shards is equal to 2 and you request 4 slices, the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard.
35
+ # IMPORTANT: The same point-in-time ID should be used for all slices.
36
+ # If different PIT IDs are used, slices can overlap and miss documents.
37
+ # This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index.
28
38
  #
29
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search.
30
- # Supports wildcards (+*+).
39
+ # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search.
40
+ # It supports wildcards (+*+).
31
41
  # To search all data streams and indices, omit this parameter or use +*+ or +_all+.
32
42
  # @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.
33
43
  # This behavior applies even if the request targets other open indices.
34
44
  # 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.
35
- # @option arguments [Boolean] :allow_partial_search_results If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. Server default: true.
36
- # @option arguments [String] :analyzer Analyzer to use for the query string.
37
- # This parameter can only be used when the q query string parameter is specified.
38
- # @option arguments [Boolean] :analyze_wildcard If true, wildcard and prefix queries are analyzed.
39
- # This parameter can only be used when the q query string parameter is specified.
45
+ # @option arguments [Boolean] :allow_partial_search_results If +true+ and there are shard request timeouts or shard failures, the request returns partial results.
46
+ # If +false+, it returns an error with no partial results.To override the default behavior, you can set the +search.default_allow_partial_results+ cluster setting to +false+. Server default: true.
47
+ # @option arguments [String] :analyzer The analyzer to use for the query string.
48
+ # This parameter can be used only when the +q+ query string parameter is specified.
49
+ # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed.
50
+ # This parameter can be used only when the +q+ query string parameter is specified.
40
51
  # @option arguments [Integer] :batched_reduce_size The number of shard results that should be reduced at once on the coordinating node.
41
- # This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. Server default: 512.
42
- # @option arguments [Boolean] :ccs_minimize_roundtrips If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. Server default: true.
43
- # @option arguments [String] :default_operator The default operator for query string query: AND or OR.
44
- # This parameter can only be used when the +q+ query string parameter is specified. Server default: OR.
45
- # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
46
- # This parameter can only be used when the q query string parameter is specified.
47
- # @option arguments [String, Array<String>] :docvalue_fields A comma-separated list of fields to return as the docvalue representation for each hit.
48
- # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
52
+ # If the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request. Server default: 512.
53
+ # @option arguments [Boolean] :ccs_minimize_roundtrips If +true+, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests. Server default: true.
54
+ # @option arguments [String] :default_operator The default operator for the query string query: +AND+ or +OR+.
55
+ # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR.
56
+ # @option arguments [String] :df The field to use as a default when no field prefix is given in the query string.
57
+ # This parameter can be used only when the +q+ query string parameter is specified.
58
+ # @option arguments [String, Array<String>] :docvalue_fields A comma-separated list of fields to return as the docvalue representation of a field for each hit.
59
+ # @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
49
60
  # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
50
- # Supports comma-separated values, such as +open,hidden+.
51
- # @option arguments [Boolean] :explain If +true+, returns detailed information about score computation as part of a hit.
61
+ # It supports comma-separated values such as +open,hidden+. Server default: open.
62
+ # @option arguments [Boolean] :explain If +true+, the request returns detailed information about score computation as part of a hit.
52
63
  # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded or aliased indices will be ignored when frozen. Server default: true.
53
64
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
54
- # @option arguments [Boolean] :include_named_queries_score Indicates whether hit.matched_queries should be rendered as a map that includes
55
- # the name of the matched query associated with its score (true)
56
- # or as an array containing the name of the matched queries (false)
57
- # This functionality reruns each named query on every hit in a search response.
65
+ # @option arguments [Boolean] :include_named_queries_score If +true+, the response includes the score contribution from any named queries.This functionality reruns each named query on every hit in a search response.
58
66
  # Typically, this adds a small overhead to a request.
59
67
  # However, using computationally expensive named queries on a large number of hits may add significant overhead.
60
68
  # @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.
61
- # This parameter can only be used when the +q+ query string parameter is specified.
62
- # @option arguments [Integer] :max_concurrent_shard_requests Defines the number of concurrent shard requests per node this search executes concurrently.
69
+ # This parameter can be used only when the +q+ query string parameter is specified.
70
+ # @option arguments [Integer] :max_concurrent_shard_requests The number of concurrent shard requests per node that the search runs concurrently.
63
71
  # This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. Server default: 5.
64
- # @option arguments [String] :preference Nodes and shards used for the search.
65
- # By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are:
66
- # +_only_local+ to run the search only on shards on the local node;
67
- # +_local+ to, if possible, run the search on shards on the local node, or if not, select shards using the default method;
68
- # +_only_nodes:<node-id>,<node-id>+ to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method;
69
- # +_prefer_nodes:<node-id>,<node-id>+ to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method;
70
- # +_shards:<shard>,<shard>+ to run the search only on the specified shards;
72
+ # @option arguments [String] :preference The nodes and shards used for the search.
73
+ # By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness.
74
+ # Valid values are:
75
+ # - +_only_local+ to run the search only on shards on the local node.
76
+ # - +_local+ to, if possible, run the search on shards on the local node, or if not, select shards using the default method.
77
+ # - +_only_nodes:<node-id>,<node-id>+ to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.
78
+ # - +_prefer_nodes:<node-id>,<node-id>+ to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.
79
+ # +_shards:<shard>,<shard>+ to run the search only on the specified shards. You can combine this value with other +preference+ values. However, the +_shards+ value must come first. For example: +_shards:2,3|_local+.
71
80
  # +<custom-string>+ (any string that does not start with +_+) to route searches with the same +<custom-string>+ to the same shards in the same order.
72
- # @option arguments [Integer] :pre_filter_shard_size Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.
81
+ # @option arguments [Integer] :pre_filter_shard_size A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.
73
82
  # This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).
74
83
  # When unspecified, the pre-filter phase is executed if any of these conditions is met:
75
- # the request targets more than 128 shards;
76
- # the request targets one or more read-only index;
77
- # the primary sort of the query targets an indexed field.
84
+ # - The request targets more than 128 shards.
85
+ # - The request targets one or more read-only index.
86
+ # - The primary sort of the query targets an indexed field.
78
87
  # @option arguments [Boolean] :request_cache If +true+, the caching of search results is enabled for requests where +size+ is +0+.
79
- # Defaults to index level settings.
80
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
81
- # @option arguments [Time] :scroll Period to retain the search context for scrolling. See Scroll search results.
88
+ # It defaults to index level settings.
89
+ # @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
90
+ # @option arguments [Time] :scroll The period to retain the search context for scrolling.
82
91
  # By default, this value cannot exceed +1d+ (24 hours).
83
- # You can change this limit using the +search.max_keep_alive+ cluster-level setting.
84
- # @option arguments [String] :search_type How distributed term frequencies are calculated for relevance scoring.
92
+ # You can change this limit by using the +search.max_keep_alive+ cluster-level setting.
93
+ # @option arguments [String] :search_type Indicates how distributed term frequencies are calculated for relevance scoring.
85
94
  # @option arguments [Array<String>] :stats Specific +tag+ of the request for logging and statistical purposes.
86
95
  # @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return as part of a hit.
87
96
  # If no fields are specified, no stored fields are included in the response.
88
97
  # If this field is specified, the +_source+ parameter defaults to +false+.
89
98
  # You can pass +_source: true+ to return both source fields and stored fields in the search response.
90
- # @option arguments [String] :suggest_field Specifies which field to use for suggestions.
91
- # @option arguments [String] :suggest_mode Specifies the suggest mode.
92
- # This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified. Server default: missing.
93
- # @option arguments [Integer] :suggest_size Number of suggestions to return.
94
- # This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified.
99
+ # @option arguments [String] :suggest_field The field to use for suggestions.
100
+ # @option arguments [String] :suggest_mode The suggest mode.
101
+ # This parameter can be used only when the +suggest_field+ and +suggest_text+ query string parameters are specified. Server default: missing.
102
+ # @option arguments [Integer] :suggest_size The number of suggestions to return.
103
+ # This parameter can be used only when the +suggest_field+ and +suggest_text+ query string parameters are specified.
95
104
  # @option arguments [String] :suggest_text The source text for which the suggestions should be returned.
96
- # This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified.
97
- # @option arguments [Integer] :terminate_after Maximum number of documents to collect for each shard.
105
+ # This parameter can be used only when the +suggest_field+ and +suggest_text+ query string parameters are specified.
106
+ # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard.
98
107
  # If a query reaches this limit, Elasticsearch terminates the query early.
99
- # Elasticsearch collects documents before sorting.
100
- # Use with caution.
108
+ # Elasticsearch collects documents before sorting.IMPORTANT: Use with caution.
101
109
  # Elasticsearch applies this parameter to each shard handling the request.
102
110
  # When possible, let Elasticsearch perform early termination automatically.
103
111
  # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
104
112
  # If set to +0+ (default), the query does not terminate early. Server default: 0.
105
- # @option arguments [Time] :timeout Specifies the period of time to wait for a response from each shard.
113
+ # @option arguments [Time] :timeout The period of time to wait for a response from each shard.
106
114
  # If no response is received before the timeout expires, the request fails and returns an error.
107
- # @option arguments [Boolean, Integer] :track_total_hits Number of hits matching the query to count accurately.
115
+ # It defaults to no timeout.
116
+ # @option arguments [Boolean, Integer] :track_total_hits The number of hits matching the query to count accurately.
108
117
  # If +true+, the exact number of hits is returned at the cost of some performance.
109
118
  # If +false+, the response does not include the total number of hits matching the query. Server default: 10000.
110
- # @option arguments [Boolean] :track_scores If +true+, calculate and return document scores, even if the scores are not used for sorting.
111
- # @option arguments [Boolean] :typed_keys If +true+, aggregation and suggester names are be prefixed by their respective types in the response. Server default: true.
119
+ # @option arguments [Boolean] :track_scores If +true+, the request calculates and returns document scores, even if the scores are not used for sorting.
120
+ # @option arguments [Boolean] :typed_keys If +true+, aggregation and suggester names are be prefixed by their respective types in the response.
112
121
  # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether +hits.total+ should be rendered as an integer or an object in the rest search response.
113
- # @option arguments [Boolean] :version If +true+, returns document version as part of a hit.
114
- # @option arguments [Boolean, String, Array<String>] :_source Indicates which source fields are returned for matching documents.
122
+ # @option arguments [Boolean] :version If +true+, the request returns the document version as part of a hit.
123
+ # @option arguments [Boolean, String, Array<String>] :_source The source fields that are returned for matching documents.
115
124
  # These fields are returned in the +hits._source+ property of the search response.
116
125
  # Valid values are:
117
- # +true+ to return the entire document source;
118
- # +false+ to not return the document source;
119
- # +<string>+ to return the source fields that are specified as a comma-separated list (supports wildcard (+*+) patterns). Server default: true.
126
+ # - +true+ to return the entire document source.
127
+ # - +false+ to not return the document source.
128
+ # - +<string>+ to return the source fields that are specified as a comma-separated list that supports wildcard (+*+) patterns. Server default: true.
120
129
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
121
130
  # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter.
122
131
  # If the +_source+ parameter is +false+, this parameter is ignored.
@@ -124,31 +133,30 @@ module ElasticsearchServerless
124
133
  # If this parameter is specified, only these source fields are returned.
125
134
  # You can exclude fields from this subset using the +_source_excludes+ query parameter.
126
135
  # If the +_source+ parameter is +false+, this parameter is ignored.
127
- # @option arguments [Boolean] :seq_no_primary_term If +true+, returns sequence number and primary term of the last modification of each hit.
128
- # @option arguments [String] :q Query in the Lucene query string syntax using query parameter search.
129
- # Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.
130
- # @option arguments [Integer] :size Defines the number of hits to return.
136
+ # @option arguments [Boolean] :seq_no_primary_term If +true+, the request returns the sequence number and primary term of the last modification of each hit.
137
+ # @option arguments [String] :q A query in the Lucene query string syntax.
138
+ # Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.IMPORTANT: This parameter overrides the query parameter in the request body.
139
+ # If both parameters are specified, documents matching the query request body parameter are not returned.
140
+ # @option arguments [Integer] :size The number of hits to return.
131
141
  # By default, you cannot page through more than 10,000 hits using the +from+ and +size+ parameters.
132
142
  # To page through more hits, use the +search_after+ parameter. Server default: 10.
133
- # @option arguments [Integer] :from Starting document offset.
134
- # Needs to be non-negative.
143
+ # @option arguments [Integer] :from The starting document offset, which must be non-negative.
135
144
  # By default, you cannot page through more than 10,000 hits using the +from+ and +size+ parameters.
136
145
  # To page through more hits, use the +search_after+ parameter. Server default: 0.
137
- # @option arguments [String] :sort A comma-separated list of <field>:<direction> pairs.
146
+ # @option arguments [String] :sort A comma-separated list of +<field>:<direction>+ pairs.
138
147
  # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source?
139
148
  # Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance.
140
149
  # Fetches with this enabled will be slower the enabling synthetic source natively in the index.
141
150
  # @option arguments [Hash] :headers Custom HTTP headers
142
151
  # @option arguments [Hash] :body request body
143
152
  #
144
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html
153
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search
145
154
  #
146
155
  def search(arguments = {})
147
- request_opts = { endpoint: arguments[:endpoint] || "search" }
156
+ request_opts = { endpoint: arguments[:endpoint] || 'search' }
148
157
 
149
- defined_params = [:index].inject({}) do |set_variables, variable|
158
+ defined_params = [:index].each_with_object({}) do |variable, set_variables|
150
159
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
151
- set_variables
152
160
  end
153
161
  request_opts[:defined_params] = defined_params unless defined_params.empty?
154
162
 
@@ -168,7 +176,7 @@ module ElasticsearchServerless
168
176
  path = if _index
169
177
  "#{Utils.listify(_index)}/_search"
170
178
  else
171
- "_search"
179
+ '_search'
172
180
  end
173
181
  params = Utils.process_params(arguments)
174
182
 
@@ -29,17 +29,16 @@ module ElasticsearchServerless
29
29
  # as-is with no warranties. Beta features are not subject to the support
30
30
  # SLA of official GA features.
31
31
  #
32
- # @option arguments [String] :name The name of the search application to delete (*Required*)
32
+ # @option arguments [String] :name The name of the search application to delete. (*Required*)
33
33
  # @option arguments [Hash] :headers Custom HTTP headers
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-search-application.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete
36
36
  #
37
37
  def delete(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "search_application.delete" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'search_application.delete' }
39
39
 
40
- defined_params = [:name].inject({}) do |set_variables, variable|
40
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
41
41
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
42
- set_variables
43
42
  end
44
43
  request_opts[:defined_params] = defined_params unless defined_params.empty?
45
44
 
@@ -32,14 +32,13 @@ module ElasticsearchServerless
32
32
  # @option arguments [String] :name The name of the analytics collection to be deleted (*Required*)
33
33
  # @option arguments [Hash] :headers Custom HTTP headers
34
34
  #
35
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-analytics-collection.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete-behavioral-analytics
36
36
  #
37
37
  def delete_behavioral_analytics(arguments = {})
38
- request_opts = { endpoint: arguments[:endpoint] || "search_application.delete_behavioral_analytics" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'search_application.delete_behavioral_analytics' }
39
39
 
40
- defined_params = [:name].inject({}) do |set_variables, variable|
40
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
41
41
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
42
- set_variables
43
42
  end
44
43
  request_opts[:defined_params] = defined_params unless defined_params.empty?
45
44
 
@@ -31,14 +31,13 @@ module ElasticsearchServerless
31
31
  # @option arguments [String] :name The name of the search application (*Required*)
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  #
34
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-search-application.html
34
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get
35
35
  #
36
36
  def get(arguments = {})
37
- request_opts = { endpoint: arguments[:endpoint] || "search_application.get" }
37
+ request_opts = { endpoint: arguments[:endpoint] || 'search_application.get' }
38
38
 
39
- defined_params = [:name].inject({}) do |set_variables, variable|
39
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
40
40
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
- set_variables
42
41
  end
43
42
  request_opts[:defined_params] = defined_params unless defined_params.empty?
44
43
 
@@ -31,14 +31,13 @@ module ElasticsearchServerless
31
31
  # @option arguments [Array<String>] :name A list of analytics collections to limit the returned information
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  #
34
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-analytics-collection.html
34
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics
35
35
  #
36
36
  def get_behavioral_analytics(arguments = {})
37
- request_opts = { endpoint: arguments[:endpoint] || "search_application.get_behavioral_analytics" }
37
+ request_opts = { endpoint: arguments[:endpoint] || 'search_application.get_behavioral_analytics' }
38
38
 
39
- defined_params = [:name].inject({}) do |set_variables, variable|
39
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
40
40
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
- set_variables
42
41
  end
43
42
  request_opts[:defined_params] = defined_params unless defined_params.empty?
44
43
 
@@ -53,7 +52,7 @@ module ElasticsearchServerless
53
52
  path = if _name
54
53
  "_application/analytics/#{Utils.listify(_name)}"
55
54
  else
56
- "_application/analytics"
55
+ '_application/analytics'
57
56
  end
58
57
  params = {}
59
58
 
@@ -22,7 +22,8 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module SearchApplication
24
24
  module Actions
25
- # Returns the existing search applications.
25
+ # Get search applications.
26
+ # Get information about search applications.
26
27
  # This functionality is in Beta and is subject to change. The design and
27
28
  # code is less mature than official GA features and is being provided
28
29
  # as-is with no warranties. Beta features are not subject to the support
@@ -33,10 +34,10 @@ module ElasticsearchServerless
33
34
  # @option arguments [Integer] :size Specifies a max number of results to get.
34
35
  # @option arguments [Hash] :headers Custom HTTP headers
35
36
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-search-applications.html
37
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics
37
38
  #
38
39
  def list(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "search_application.list" }
40
+ request_opts = { endpoint: arguments[:endpoint] || 'search_application.list' }
40
41
 
41
42
  arguments = arguments.clone
42
43
  headers = arguments.delete(:headers) || {}
@@ -44,7 +45,7 @@ module ElasticsearchServerless
44
45
  body = nil
45
46
 
46
47
  method = ElasticsearchServerless::API::HTTP_GET
47
- path = "_application/search_application"
48
+ path = '_application/search_application'
48
49
  params = Utils.process_params(arguments)
49
50
 
50
51
  ElasticsearchServerless::API::Response.new(
@@ -33,14 +33,13 @@ module ElasticsearchServerless
33
33
  # @option arguments [Hash] :headers Custom HTTP headers
34
34
  # @option arguments [Hash] :body search_application
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-search-application.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put
37
37
  #
38
38
  def put(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "search_application.put" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'search_application.put' }
40
40
 
41
- defined_params = [:name].inject({}) do |set_variables, variable|
41
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
@@ -31,14 +31,13 @@ module ElasticsearchServerless
31
31
  # @option arguments [String] :name The name of the analytics collection to be created or updated. (*Required*)
32
32
  # @option arguments [Hash] :headers Custom HTTP headers
33
33
  #
34
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-analytics-collection.html
34
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put-behavioral-analytics
35
35
  #
36
36
  def put_behavioral_analytics(arguments = {})
37
- request_opts = { endpoint: arguments[:endpoint] || "search_application.put_behavioral_analytics" }
37
+ request_opts = { endpoint: arguments[:endpoint] || 'search_application.put_behavioral_analytics' }
38
38
 
39
- defined_params = [:name].inject({}) do |set_variables, variable|
39
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
40
40
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
- set_variables
42
41
  end
43
42
  request_opts[:defined_params] = defined_params unless defined_params.empty?
44
43
 
@@ -35,14 +35,13 @@ module ElasticsearchServerless
35
35
  # @option arguments [Hash] :headers Custom HTTP headers
36
36
  # @option arguments [Hash] :body request body
37
37
  #
38
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-search.html
38
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-search
39
39
  #
40
40
  def search(arguments = {})
41
- request_opts = { endpoint: arguments[:endpoint] || "search_application.search" }
41
+ request_opts = { endpoint: arguments[:endpoint] || 'search_application.search' }
42
42
 
43
- defined_params = [:name].inject({}) do |set_variables, variable|
43
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
44
44
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
45
- set_variables
46
45
  end
47
46
  request_opts[:defined_params] = defined_params unless defined_params.empty?
48
47
 
@@ -23,41 +23,163 @@ module ElasticsearchServerless
23
23
  module Actions
24
24
  # Search a vector tile.
25
25
  # Search a vector tile for geospatial values.
26
+ # Before using this API, you should be familiar with the Mapbox vector tile specification.
27
+ # The API returns results as a binary mapbox vector tile.
28
+ # Internally, Elasticsearch translates a vector tile search API request into a search containing:
29
+ # * A +geo_bounding_box+ query on the +<field>+. The query uses the +<zoom>/<x>/<y>+ tile as a bounding box.
30
+ # * A +geotile_grid+ or +geohex_grid+ aggregation on the +<field>+. The +grid_agg+ parameter determines the aggregation type. The aggregation uses the +<zoom>/<x>/<y>+ tile as a bounding box.
31
+ # * Optionally, a +geo_bounds+ aggregation on the +<field>+. The search only includes this aggregation if the +exact_bounds+ parameter is +true+.
32
+ # * If the optional parameter +with_labels+ is +true+, the internal search will include a dynamic runtime field that calls the +getLabelPosition+ function of the geometry doc value. This enables the generation of new point features containing suggested geometry labels, so that, for example, multi-polygons will have only one label.
33
+ # For example, Elasticsearch may translate a vector tile search API request with a +grid_agg+ argument of +geotile+ and an +exact_bounds+ argument of +true+ into the following search
34
+ # +
35
+ # GET my-index/_search
36
+ # {
37
+ # "size": 10000,
38
+ # "query": {
39
+ # "geo_bounding_box": {
40
+ # "my-geo-field": {
41
+ # "top_left": {
42
+ # "lat": -40.979898069620134,
43
+ # "lon": -45
44
+ # },
45
+ # "bottom_right": {
46
+ # "lat": -66.51326044311186,
47
+ # "lon": 0
48
+ # }
49
+ # }
50
+ # }
51
+ # },
52
+ # "aggregations": {
53
+ # "grid": {
54
+ # "geotile_grid": {
55
+ # "field": "my-geo-field",
56
+ # "precision": 11,
57
+ # "size": 65536,
58
+ # "bounds": {
59
+ # "top_left": {
60
+ # "lat": -40.979898069620134,
61
+ # "lon": -45
62
+ # },
63
+ # "bottom_right": {
64
+ # "lat": -66.51326044311186,
65
+ # "lon": 0
66
+ # }
67
+ # }
68
+ # }
69
+ # },
70
+ # "bounds": {
71
+ # "geo_bounds": {
72
+ # "field": "my-geo-field",
73
+ # "wrap_longitude": false
74
+ # }
75
+ # }
76
+ # }
77
+ # }
78
+ # +
79
+ # The API returns results as a binary Mapbox vector tile.
80
+ # Mapbox vector tiles are encoded as Google Protobufs (PBF). By default, the tile contains three layers:
81
+ # * A +hits+ layer containing a feature for each +<field>+ value matching the +geo_bounding_box+ query.
82
+ # * An +aggs+ layer containing a feature for each cell of the +geotile_grid+ or +geohex_grid+. The layer only contains features for cells with matching data.
83
+ # * A meta layer containing:
84
+ # * A feature containing a bounding box. By default, this is the bounding box of the tile.
85
+ # * Value ranges for any sub-aggregations on the +geotile_grid+ or +geohex_grid+.
86
+ # * Metadata for the search.
87
+ # The API only returns features that can display at its zoom level.
88
+ # For example, if a polygon feature has no area at its zoom level, the API omits it.
89
+ # The API returns errors as UTF-8 encoded JSON.
90
+ # IMPORTANT: You can specify several options for this API as either a query parameter or request body parameter.
91
+ # If you specify both parameters, the query parameter takes precedence.
92
+ # **Grid precision for geotile**
93
+ # For a +grid_agg+ of +geotile+, you can use cells in the +aggs+ layer as tiles for lower zoom levels.
94
+ # +grid_precision+ represents the additional zoom levels available through these cells. The final precision is computed by as follows: +<zoom> + grid_precision+.
95
+ # For example, if +<zoom>+ is 7 and +grid_precision+ is 8, then the +geotile_grid+ aggregation will use a precision of 15.
96
+ # The maximum final precision is 29.
97
+ # The +grid_precision+ also determines the number of cells for the grid as follows: +(2^grid_precision) x (2^grid_precision)+.
98
+ # For example, a value of 8 divides the tile into a grid of 256 x 256 cells.
99
+ # The +aggs+ layer only contains features for cells with matching data.
100
+ # **Grid precision for geohex**
101
+ # For a +grid_agg+ of +geohex+, Elasticsearch uses +<zoom>+ and +grid_precision+ to calculate a final precision as follows: +<zoom> + grid_precision+.
102
+ # This precision determines the H3 resolution of the hexagonal cells produced by the +geohex+ aggregation.
103
+ # The following table maps the H3 resolution for each precision.
104
+ # For example, if +<zoom>+ is 3 and +grid_precision+ is 3, the precision is 6.
105
+ # At a precision of 6, hexagonal cells have an H3 resolution of 2.
106
+ # If +<zoom>+ is 3 and +grid_precision+ is 4, the precision is 7.
107
+ # At a precision of 7, hexagonal cells have an H3 resolution of 3.
108
+ # | Precision | Unique tile bins | H3 resolution | Unique hex bins | Ratio |
109
+ # | --------- | ---------------- | ------------- | ----------------| ----- |
110
+ # | 1 | 4 | 0 | 122 | 30.5 |
111
+ # | 2 | 16 | 0 | 122 | 7.625 |
112
+ # | 3 | 64 | 1 | 842 | 13.15625 |
113
+ # | 4 | 256 | 1 | 842 | 3.2890625 |
114
+ # | 5 | 1024 | 2 | 5882 | 5.744140625 |
115
+ # | 6 | 4096 | 2 | 5882 | 1.436035156 |
116
+ # | 7 | 16384 | 3 | 41162 | 2.512329102 |
117
+ # | 8 | 65536 | 3 | 41162 | 0.6280822754 |
118
+ # | 9 | 262144 | 4 | 288122 | 1.099098206 |
119
+ # | 10 | 1048576 | 4 | 288122 | 0.2747745514 |
120
+ # | 11 | 4194304 | 5 | 2016842 | 0.4808526039 |
121
+ # | 12 | 16777216 | 6 | 14117882 | 0.8414913416 |
122
+ # | 13 | 67108864 | 6 | 14117882 | 0.2103728354 |
123
+ # | 14 | 268435456 | 7 | 98825162 | 0.3681524172 |
124
+ # | 15 | 1073741824 | 8 | 691776122 | 0.644266719 |
125
+ # | 16 | 4294967296 | 8 | 691776122 | 0.1610666797 |
126
+ # | 17 | 17179869184 | 9 | 4842432842 | 0.2818666889 |
127
+ # | 18 | 68719476736 | 10 | 33897029882 | 0.4932667053 |
128
+ # | 19 | 274877906944 | 11 | 237279209162 | 0.8632167343 |
129
+ # | 20 | 1099511627776 | 11 | 237279209162 | 0.2158041836 |
130
+ # | 21 | 4398046511104 | 12 | 1660954464122 | 0.3776573213 |
131
+ # | 22 | 17592186044416 | 13 | 11626681248842 | 0.6609003122 |
132
+ # | 23 | 70368744177664 | 13 | 11626681248842 | 0.165225078 |
133
+ # | 24 | 281474976710656 | 14 | 81386768741882 | 0.2891438866 |
134
+ # | 25 | 1125899906842620 | 15 | 569707381193162 | 0.5060018015 |
135
+ # | 26 | 4503599627370500 | 15 | 569707381193162 | 0.1265004504 |
136
+ # | 27 | 18014398509482000 | 15 | 569707381193162 | 0.03162511259 |
137
+ # | 28 | 72057594037927900 | 15 | 569707381193162 | 0.007906278149 |
138
+ # | 29 | 288230376151712000 | 15 | 569707381193162 | 0.001976569537 |
139
+ # Hexagonal cells don't align perfectly on a vector tile.
140
+ # Some cells may intersect more than one vector tile.
141
+ # To compute the H3 resolution for each precision, Elasticsearch compares the average density of hexagonal bins at each resolution with the average density of tile bins at each zoom level.
142
+ # Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density.
26
143
  #
27
144
  # @option arguments [String, Array] :index Comma-separated list of data streams, indices, or aliases to search (*Required*)
28
145
  # @option arguments [String] :field Field containing geospatial data to return (*Required*)
29
146
  # @option arguments [Integer] :zoom Zoom level for the vector tile to search (*Required*)
30
147
  # @option arguments [Integer] :x X coordinate for the vector tile to search (*Required*)
31
148
  # @option arguments [Integer] :y Y coordinate for the vector tile to search (*Required*)
32
- # @option arguments [Boolean] :exact_bounds If false, the meta layers feature is the bounding box of the tile.
33
- # If true, the meta layers feature is a bounding box resulting from a
149
+ # @option arguments [Boolean] :exact_bounds If +false+, the meta layer's feature is the bounding box of the tile.
150
+ # If true, the meta layer's feature is a bounding box resulting from a
34
151
  # geo_bounds aggregation. The aggregation runs on <field> values that intersect
35
152
  # the <zoom>/<x>/<y> tile with wrap_longitude set to false. The resulting
36
153
  # bounding box may be larger than the vector tile.
37
- # @option arguments [Integer] :extent Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. Server default: 4096.
154
+ # @option arguments [Integer] :extent The size, in pixels, of a side of the tile. Vector tiles are square with equal sides. Server default: 4096.
38
155
  # @option arguments [String] :grid_agg Aggregation used to create a grid for +field+.
39
156
  # @option arguments [Integer] :grid_precision Additional zoom levels available through the aggs layer. For example, if <zoom> is 7
40
157
  # and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
41
- # dont include the aggs layer. Server default: 8.
158
+ # don't include the aggs layer. Server default: 8.
42
159
  # @option arguments [String] :grid_type Determines the geometry type for features in the aggs layer. In the aggs layer,
43
160
  # each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
44
161
  # of the cells bounding box. If 'point' each feature is a Point that is the centroid
45
162
  # of the cell. Server default: grid.
46
163
  # @option arguments [Integer] :size Maximum number of features to return in the hits layer. Accepts 0-10000.
47
- # If 0, results dont include the hits layer. Server default: 10000.
164
+ # If 0, results don't include the hits layer. Server default: 10000.
48
165
  # @option arguments [Boolean] :with_labels If +true+, the hits and aggs layers will contain additional point features representing
49
166
  # suggested label positions for the original features.
167
+ # - +Point+ and +MultiPoint+ features will have one of the points selected.
168
+ # - +Polygon+ and +MultiPolygon+ features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree.
169
+ # - +LineString+ features will likewise provide a roughly central point selected from the triangle-tree.
170
+ # - The aggregation results will provide one central point for each aggregation bucket.
171
+ # All attributes from the original features will also be copied to the new label features.
172
+ # In addition, the new features will be distinguishable using the tag +_mvt_label_position+.
50
173
  # @option arguments [Hash] :headers Custom HTTP headers
51
174
  # @option arguments [Hash] :body request body
52
175
  #
53
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html
176
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt
54
177
  #
55
178
  def search_mvt(arguments = {})
56
- request_opts = { endpoint: arguments[:endpoint] || "search_mvt" }
179
+ request_opts = { endpoint: arguments[:endpoint] || 'search_mvt' }
57
180
 
58
- defined_params = [:index, :field, :zoom, :x, :y].inject({}) do |set_variables, variable|
181
+ defined_params = [:index, :field, :zoom, :x, :y].each_with_object({}) do |variable, set_variables|
59
182
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
60
- set_variables
61
183
  end
62
184
  request_opts[:defined_params] = defined_params unless defined_params.empty?
63
185