elasticsearch-serverless 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch-serverless/api/async_search/delete.rb +9 -1
  3. data/lib/elasticsearch-serverless/api/async_search/get.rb +17 -3
  4. data/lib/elasticsearch-serverless/api/async_search/status.rb +9 -1
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +15 -4
  6. data/lib/elasticsearch-serverless/api/bulk.rb +17 -4
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +22 -6
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +22 -6
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +25 -8
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +16 -6
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +31 -9
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +24 -8
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +29 -8
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +29 -8
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +25 -8
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +27 -9
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +12 -3
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +3 -1
  19. data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +14 -3
  20. data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +18 -5
  21. data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +16 -4
  22. data/lib/elasticsearch-serverless/api/cluster/info.rb +11 -2
  23. data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +17 -7
  24. data/lib/elasticsearch-serverless/api/connector/check_in.rb +9 -1
  25. data/lib/elasticsearch-serverless/api/connector/delete.rb +14 -6
  26. data/lib/elasticsearch-serverless/api/connector/get.rb +13 -5
  27. data/lib/elasticsearch-serverless/api/connector/list.rb +7 -5
  28. data/lib/elasticsearch-serverless/api/connector/post.rb +7 -5
  29. data/lib/elasticsearch-serverless/api/connector/put.rb +14 -6
  30. data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +13 -5
  31. data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +13 -5
  32. data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +13 -5
  33. data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +8 -6
  34. data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +7 -5
  35. data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +9 -1
  36. data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +13 -5
  37. data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +13 -5
  38. data/lib/elasticsearch-serverless/api/connector/update_error.rb +9 -1
  39. data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +13 -5
  40. data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +9 -1
  41. data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +13 -5
  42. data/lib/elasticsearch-serverless/api/connector/update_name.rb +13 -5
  43. data/lib/elasticsearch-serverless/api/connector/update_native.rb +13 -5
  44. data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +13 -5
  45. data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +13 -5
  46. data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +13 -5
  47. data/lib/elasticsearch-serverless/api/connector/update_status.rb +9 -1
  48. data/lib/elasticsearch-serverless/api/count.rb +30 -10
  49. data/lib/elasticsearch-serverless/api/create.rb +21 -5
  50. data/lib/elasticsearch-serverless/api/delete.rb +17 -5
  51. data/lib/elasticsearch-serverless/api/delete_by_query.rb +38 -11
  52. data/lib/elasticsearch-serverless/api/delete_script.rb +14 -3
  53. data/lib/elasticsearch-serverless/api/enrich/delete_policy.rb +10 -1
  54. data/lib/elasticsearch-serverless/api/enrich/execute_policy.rb +9 -1
  55. data/lib/elasticsearch-serverless/api/enrich/get_policy.rb +12 -2
  56. data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +10 -1
  57. data/lib/elasticsearch-serverless/api/enrich/stats.rb +4 -1
  58. data/lib/elasticsearch-serverless/api/eql/delete.rb +12 -2
  59. data/lib/elasticsearch-serverless/api/eql/get.rb +13 -3
  60. data/lib/elasticsearch-serverless/api/eql/get_status.rb +9 -1
  61. data/lib/elasticsearch-serverless/api/eql/search.rb +9 -1
  62. data/lib/elasticsearch-serverless/api/exists.rb +20 -6
  63. data/lib/elasticsearch-serverless/api/exists_source.rb +16 -4
  64. data/lib/elasticsearch-serverless/api/explain.rb +17 -5
  65. data/lib/elasticsearch-serverless/api/field_caps.rb +12 -2
  66. data/lib/elasticsearch-serverless/api/get.rb +18 -5
  67. data/lib/elasticsearch-serverless/api/get_script.rb +10 -1
  68. data/lib/elasticsearch-serverless/api/get_source.rb +10 -1
  69. data/lib/elasticsearch-serverless/api/graph/explore.rb +12 -2
  70. data/lib/elasticsearch-serverless/api/index.rb +25 -6
  71. data/lib/elasticsearch-serverless/api/indices/add_block.rb +11 -2
  72. data/lib/elasticsearch-serverless/api/indices/analyze.rb +12 -2
  73. data/lib/elasticsearch-serverless/api/indices/create.rb +16 -4
  74. data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +16 -2
  75. data/lib/elasticsearch-serverless/api/indices/data_streams_stats.rb +15 -3
  76. data/lib/elasticsearch-serverless/api/indices/delete.rb +25 -7
  77. data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +18 -5
  78. data/lib/elasticsearch-serverless/api/indices/delete_data_lifecycle.rb +11 -2
  79. data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +10 -1
  80. data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +9 -1
  81. data/lib/elasticsearch-serverless/api/indices/exists.rb +17 -4
  82. data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +19 -5
  83. data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +9 -1
  84. data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +11 -2
  85. data/lib/elasticsearch-serverless/api/indices/get.rb +18 -4
  86. data/lib/elasticsearch-serverless/api/indices/get_alias.rb +23 -6
  87. data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +16 -3
  88. data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +14 -3
  89. data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +9 -1
  90. data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +21 -5
  91. data/lib/elasticsearch-serverless/api/indices/get_settings.rb +26 -6
  92. data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +10 -1
  93. data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +4 -1
  94. data/lib/elasticsearch-serverless/api/indices/put_alias.rb +20 -5
  95. data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +22 -6
  96. data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +11 -2
  97. data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +20 -5
  98. data/lib/elasticsearch-serverless/api/indices/put_settings.rb +28 -7
  99. data/lib/elasticsearch-serverless/api/indices/put_template.rb +14 -3
  100. data/lib/elasticsearch-serverless/api/indices/refresh.rb +19 -4
  101. data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +15 -3
  102. data/lib/elasticsearch-serverless/api/indices/rollover.rb +19 -5
  103. data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +9 -1
  104. data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +11 -2
  105. data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +8 -3
  106. data/lib/elasticsearch-serverless/api/indices/validate_query.rb +24 -7
  107. data/lib/elasticsearch-serverless/api/inference/delete.rb +9 -1
  108. data/lib/elasticsearch-serverless/api/inference/get.rb +9 -1
  109. data/lib/elasticsearch-serverless/api/inference/inference.rb +9 -1
  110. data/lib/elasticsearch-serverless/api/inference/put.rb +9 -1
  111. data/lib/elasticsearch-serverless/api/info.rb +4 -1
  112. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +15 -4
  113. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +14 -3
  114. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +3 -1
  115. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +9 -1
  116. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +11 -2
  117. data/lib/elasticsearch-serverless/api/license/get.rb +8 -4
  118. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +9 -1
  119. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +9 -1
  120. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +9 -1
  121. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +14 -4
  122. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +10 -1
  123. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +12 -3
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +12 -3
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +10 -2
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +16 -4
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +10 -2
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +17 -6
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +11 -3
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +10 -2
  131. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +4 -1
  132. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +4 -2
  133. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +19 -6
  134. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +9 -1
  135. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +9 -1
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +24 -4
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +21 -3
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +20 -3
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +23 -4
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +9 -1
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +21 -3
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +23 -4
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +30 -7
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +28 -7
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +17 -3
  146. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +9 -1
  147. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +10 -2
  148. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +9 -1
  149. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +9 -1
  150. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +13 -2
  151. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +9 -1
  152. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +9 -1
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +12 -2
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +17 -5
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +9 -1
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +11 -2
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +14 -3
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +12 -2
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +11 -2
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +9 -1
  161. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +14 -3
  162. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +14 -3
  163. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +27 -8
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +25 -5
  165. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +23 -4
  166. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +19 -3
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +15 -3
  168. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +12 -2
  169. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +21 -4
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +9 -1
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +9 -1
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +15 -2
  173. data/lib/elasticsearch-serverless/api/mget.rb +17 -4
  174. data/lib/elasticsearch-serverless/api/msearch.rb +15 -1
  175. data/lib/elasticsearch-serverless/api/msearch_template.rb +16 -4
  176. data/lib/elasticsearch-serverless/api/mtermvectors.rb +14 -8
  177. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +14 -3
  178. data/lib/elasticsearch-serverless/api/ping.rb +4 -1
  179. data/lib/elasticsearch-serverless/api/put_script.rb +18 -5
  180. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +9 -1
  181. data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +9 -1
  182. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +9 -1
  183. data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +9 -1
  184. data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +3 -1
  185. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +9 -1
  186. data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +9 -1
  187. data/lib/elasticsearch-serverless/api/rank_eval.rb +11 -2
  188. data/lib/elasticsearch-serverless/api/reindex.rb +11 -7
  189. data/lib/elasticsearch-serverless/api/render_search_template.rb +11 -2
  190. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +4 -1
  191. data/lib/elasticsearch-serverless/api/scroll.rb +9 -1
  192. data/lib/elasticsearch-serverless/api/search.rb +107 -30
  193. data/lib/elasticsearch-serverless/api/search_application/delete.rb +9 -1
  194. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +9 -1
  195. data/lib/elasticsearch-serverless/api/search_application/get.rb +9 -1
  196. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +9 -1
  197. data/lib/elasticsearch-serverless/api/search_application/list.rb +3 -1
  198. data/lib/elasticsearch-serverless/api/search_application/put.rb +9 -1
  199. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +9 -1
  200. data/lib/elasticsearch-serverless/api/search_application/search.rb +9 -1
  201. data/lib/elasticsearch-serverless/api/search_mvt.rb +27 -7
  202. data/lib/elasticsearch-serverless/api/search_template.rb +22 -6
  203. data/lib/elasticsearch-serverless/api/security/authenticate.rb +6 -2
  204. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +4 -1
  205. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +19 -7
  206. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +10 -1
  207. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +4 -1
  208. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +7 -3
  209. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +10 -1
  210. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +3 -1
  211. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +9 -1
  212. data/lib/elasticsearch-serverless/api/sql/get_async.rb +15 -4
  213. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +9 -1
  214. data/lib/elasticsearch-serverless/api/sql/query.rb +3 -1
  215. data/lib/elasticsearch-serverless/api/sql/translate.rb +3 -1
  216. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +9 -1
  217. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +9 -1
  218. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +9 -1
  219. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +9 -1
  220. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +3 -1
  221. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -1
  222. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -1
  223. data/lib/elasticsearch-serverless/api/tasks/get.rb +13 -3
  224. data/lib/elasticsearch-serverless/api/terms_enum.rb +9 -1
  225. data/lib/elasticsearch-serverless/api/termvectors.rb +21 -9
  226. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +14 -3
  227. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +23 -4
  228. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +20 -3
  229. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +15 -5
  230. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +17 -7
  231. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +14 -3
  232. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +11 -3
  233. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +10 -3
  234. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +23 -6
  235. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +15 -4
  236. data/lib/elasticsearch-serverless/api/update.rb +23 -7
  237. data/lib/elasticsearch-serverless/api/update_by_query.rb +36 -9
  238. data/lib/elasticsearch-serverless/api.rb +3 -2
  239. data/lib/elasticsearch-serverless/version.rb +1 -1
  240. data/lib/elasticsearch-serverless.rb +4 -3
  241. metadata +5 -76
  242. data/lib/elasticsearch-serverless/api/connector/last_sync.rb +0 -59
@@ -37,6 +37,14 @@ module ElasticsearchServerless
37
37
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#request-body-search-scroll
38
38
  #
39
39
  def scroll(arguments = {})
40
+ request_opts = { endpoint: arguments[:endpoint] || "scroll" }
41
+
42
+ defined_params = [:scroll_id].inject({}) do |set_variables, variable|
43
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
44
+ set_variables
45
+ end
46
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
47
+
40
48
  arguments = arguments.clone
41
49
  headers = arguments.delete(:headers) || {}
42
50
 
@@ -58,7 +66,7 @@ module ElasticsearchServerless
58
66
  params = Utils.process_params(arguments)
59
67
 
60
68
  ElasticsearchServerless::API::Response.new(
61
- perform_request(method, path, params, body, headers)
69
+ perform_request(method, path, params, body, headers, request_opts)
62
70
  )
63
71
  end
64
72
  end
@@ -25,57 +25,134 @@ module ElasticsearchServerless
25
25
  # You can provide search queries using the +q+ query string parameter or the request body.
26
26
  # If both are specified, only the query parameter is used.
27
27
  #
28
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (+*+). To search all data streams and indices, omit this parameter or use +*+ or +_all+.
29
- # @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. This behavior applies even if the request targets other open indices. 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.
28
+ # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search.
29
+ # Supports wildcards (+*+).
30
+ # To search all data streams and indices, omit this parameter or use +*+ or +_all+.
31
+ # @option arguments [Boolean] :allow_no_indices If +false+, the request returns an error if any wildcard expression, index alias, or +_all+ value targets only missing or closed indices.
32
+ # This behavior applies even if the request targets other open indices.
33
+ # 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.
30
34
  # @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.
31
- # @option arguments [String] :analyzer Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified.
32
- # @option arguments [Boolean] :analyze_wildcard If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified.
33
- # @option arguments [Integer] :batched_reduce_size The number of shard results that should be reduced at once on the coordinating node. 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.
35
+ # @option arguments [String] :analyzer Analyzer to use for the query string.
36
+ # This parameter can only be used when the q query string parameter is specified.
37
+ # @option arguments [Boolean] :analyze_wildcard If true, wildcard and prefix queries are analyzed.
38
+ # This parameter can only be used when the q query string parameter is specified.
39
+ # @option arguments [Integer] :batched_reduce_size The number of shard results that should be reduced at once on the coordinating node.
40
+ # 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.
34
41
  # @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.
35
- # @option arguments [String] :default_operator The default operator for query string query: AND or OR. This parameter can only be used when the +q+ query string parameter is specified. Server default: OR.
36
- # @option arguments [String] :df Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified.
42
+ # @option arguments [String] :default_operator The default operator for query string query: AND or OR.
43
+ # This parameter can only be used when the +q+ query string parameter is specified. Server default: OR.
44
+ # @option arguments [String] :df Field to use as default where no field prefix is given in the query string.
45
+ # This parameter can only be used when the q query string parameter is specified.
37
46
  # @option arguments [String, Array<String>] :docvalue_fields A comma-separated list of fields to return as the docvalue representation for each hit.
38
- # @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+.
47
+ # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
48
+ # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
49
+ # Supports comma-separated values, such as +open,hidden+.
39
50
  # @option arguments [Boolean] :explain If +true+, returns detailed information about score computation as part of a hit.
40
51
  # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded or aliased indices will be ignored when frozen. Server default: true.
41
52
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
42
- # @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. This parameter can only be used when the +q+ query string parameter is specified.
43
- # @option arguments [Integer] :max_concurrent_shard_requests Defines the number of concurrent shard requests per node this search executes concurrently. 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.
44
- # @option arguments [String] :min_compatible_shard_node The minimum version of the node that can handle the request Any handling node with a lower version will fail the request.
45
- # @option arguments [String] :preference Nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: +_only_local+ to run the search only on shards on the local node; +_local+ to, if possible, run the search on shards on the local node, or if not, select shards using the default method; +_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; +_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; +_shards:<shard>,<shard>+ to run the search only on the specified shards; +<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.
46
- # @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. 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). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field.
47
- # @option arguments [Boolean] :request_cache If +true+, the caching of search results is enabled for requests where +size+ is +0+. Defaults to index level settings.
53
+ # @option arguments [Boolean] :include_named_queries_score Indicates whether hit.matched_queries should be rendered as a map that includes
54
+ # the name of the matched query associated with its score (true)
55
+ # or as an array containing the name of the matched queries (false)
56
+ # This functionality reruns each named query on every hit in a search response.
57
+ # Typically, this adds a small overhead to a request.
58
+ # However, using computationally expensive named queries on a large number of hits may add significant overhead.
59
+ # @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.
60
+ # This parameter can only be used when the +q+ query string parameter is specified.
61
+ # @option arguments [Integer] :max_concurrent_shard_requests Defines the number of concurrent shard requests per node this search executes concurrently.
62
+ # 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.
63
+ # @option arguments [String] :min_compatible_shard_node The minimum version of the node that can handle the request
64
+ # Any handling node with a lower version will fail the request.
65
+ # @option arguments [String] :preference Nodes and shards used for the search.
66
+ # By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are:
67
+ # +_only_local+ to run the search only on shards on the local node;
68
+ # +_local+ to, if possible, run the search on shards on the local node, or if not, select shards using the default method;
69
+ # +_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;
70
+ # +_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;
71
+ # +_shards:<shard>,<shard>+ to run the search only on the specified shards;
72
+ # +<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.
73
+ # @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.
74
+ # 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).
75
+ # When unspecified, the pre-filter phase is executed if any of these conditions is met:
76
+ # the request targets more than 128 shards;
77
+ # the request targets one or more read-only index;
78
+ # the primary sort of the query targets an indexed field.
79
+ # @option arguments [Boolean] :request_cache If +true+, the caching of search results is enabled for requests where +size+ is +0+.
80
+ # Defaults to index level settings.
48
81
  # @option arguments [String] :routing Custom value used to route operations to a specific shard.
49
- # @option arguments [Time] :scroll Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed +1d+ (24 hours). You can change this limit using the +search.max_keep_alive+ cluster-level setting.
82
+ # @option arguments [Time] :scroll Period to retain the search context for scrolling. See Scroll search results.
83
+ # By default, this value cannot exceed +1d+ (24 hours).
84
+ # You can change this limit using the +search.max_keep_alive+ cluster-level setting.
50
85
  # @option arguments [String] :search_type How distributed term frequencies are calculated for relevance scoring.
51
86
  # @option arguments [Array<String>] :stats Specific +tag+ of the request for logging and statistical purposes.
52
- # @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the +_source+ parameter defaults to +false+. You can pass +_source: true+ to return both source fields and stored fields in the search response.
87
+ # @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return as part of a hit.
88
+ # If no fields are specified, no stored fields are included in the response.
89
+ # If this field is specified, the +_source+ parameter defaults to +false+.
90
+ # You can pass +_source: true+ to return both source fields and stored fields in the search response.
53
91
  # @option arguments [String] :suggest_field Specifies which field to use for suggestions.
54
- # @option arguments [String] :suggest_mode Specifies the suggest mode. This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified. Server default: missing.
55
- # @option arguments [Integer] :suggest_size Number of suggestions to return. This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified.
56
- # @option arguments [String] :suggest_text The source text for which the suggestions should be returned. This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified.
57
- # @option arguments [Integer] :terminate_after Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to +0+ (default), the query does not terminate early. Server default: 0.
58
- # @option arguments [Time] :timeout Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error.
59
- # @option arguments [Boolean, Integer] :track_total_hits Number of hits matching the query to count accurately. If +true+, the exact number of hits is returned at the cost of some performance. If +false+, the response does not include the total number of hits matching the query. Server default: 10000.
92
+ # @option arguments [String] :suggest_mode Specifies the suggest mode.
93
+ # This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified. Server default: missing.
94
+ # @option arguments [Integer] :suggest_size Number of suggestions to return.
95
+ # This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified.
96
+ # @option arguments [String] :suggest_text The source text for which the suggestions should be returned.
97
+ # This parameter can only be used when the +suggest_field+ and +suggest_text+ query string parameters are specified.
98
+ # @option arguments [Integer] :terminate_after Maximum number of documents to collect for each shard.
99
+ # If a query reaches this limit, Elasticsearch terminates the query early.
100
+ # Elasticsearch collects documents before sorting.
101
+ # Use with caution.
102
+ # Elasticsearch applies this parameter to each shard handling the request.
103
+ # When possible, let Elasticsearch perform early termination automatically.
104
+ # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
105
+ # If set to +0+ (default), the query does not terminate early. Server default: 0.
106
+ # @option arguments [Time] :timeout Specifies the period of time to wait for a response from each shard.
107
+ # If no response is received before the timeout expires, the request fails and returns an error.
108
+ # @option arguments [Boolean, Integer] :track_total_hits Number of hits matching the query to count accurately.
109
+ # If +true+, the exact number of hits is returned at the cost of some performance.
110
+ # If +false+, the response does not include the total number of hits matching the query. Server default: 10000.
60
111
  # @option arguments [Boolean] :track_scores If +true+, calculate and return document scores, even if the scores are not used for sorting.
61
112
  # @option arguments [Boolean] :typed_keys If +true+, aggregation and suggester names are be prefixed by their respective types in the response. Server default: true.
62
113
  # @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.
63
114
  # @option arguments [Boolean] :version If +true+, returns document version as part of a hit.
64
- # @option arguments [Boolean, String, Array<String>] :_source Indicates which source fields are returned for matching documents. These fields are returned in the +hits._source+ property of the search response. Valid values are: +true+ to return the entire document source; +false+ to not return the document source; +<string>+ to return the source fields that are specified as a comma-separated list (supports wildcard (+*+) patterns). Server default: true.
65
- # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter. If the +_source+ parameter is +false+, this parameter is ignored.
66
- # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the +_source_excludes+ query parameter. If the +_source+ parameter is +false+, this parameter is ignored.
115
+ # @option arguments [Boolean, String, Array<String>] :_source Indicates which source fields are returned for matching documents.
116
+ # These fields are returned in the +hits._source+ property of the search response.
117
+ # Valid values are:
118
+ # +true+ to return the entire document source;
119
+ # +false+ to not return the document source;
120
+ # +<string>+ to return the source fields that are specified as a comma-separated list (supports wildcard (+*+) patterns). Server default: true.
121
+ # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
122
+ # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter.
123
+ # If the +_source+ parameter is +false+, this parameter is ignored.
124
+ # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
125
+ # If this parameter is specified, only these source fields are returned.
126
+ # You can exclude fields from this subset using the +_source_excludes+ query parameter.
127
+ # If the +_source+ parameter is +false+, this parameter is ignored.
67
128
  # @option arguments [Boolean] :seq_no_primary_term If +true+, returns sequence number and primary term of the last modification of each hit.
68
- # @option arguments [String] :q Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.
69
- # @option arguments [Integer] :size Defines the number of hits to return. By default, you cannot page through more than 10,000 hits using the +from+ and +size+ parameters. To page through more hits, use the +search_after+ parameter. Server default: 10.
70
- # @option arguments [Integer] :from Starting document offset. Needs to be non-negative. By default, you cannot page through more than 10,000 hits using the +from+ and +size+ parameters. To page through more hits, use the +search_after+ parameter. Server default: 0.
129
+ # @option arguments [String] :q Query in the Lucene query string syntax using query parameter search.
130
+ # Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.
131
+ # @option arguments [Integer] :size Defines the number of hits to return.
132
+ # By default, you cannot page through more than 10,000 hits using the +from+ and +size+ parameters.
133
+ # To page through more hits, use the +search_after+ parameter. Server default: 10.
134
+ # @option arguments [Integer] :from Starting document offset.
135
+ # Needs to be non-negative.
136
+ # By default, you cannot page through more than 10,000 hits using the +from+ and +size+ parameters.
137
+ # To page through more hits, use the +search_after+ parameter. Server default: 0.
71
138
  # @option arguments [String] :sort A comma-separated list of <field>:<direction> pairs.
72
- # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.
139
+ # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source?
140
+ # Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance.
141
+ # Fetches with this enabled will be slower the enabling synthetic source natively in the index.
73
142
  # @option arguments [Hash] :headers Custom HTTP headers
74
143
  # @option arguments [Hash] :body request body
75
144
  #
76
145
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html
77
146
  #
78
147
  def search(arguments = {})
148
+ request_opts = { endpoint: arguments[:endpoint] || "search" }
149
+
150
+ defined_params = [:index].inject({}) do |set_variables, variable|
151
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
152
+ set_variables
153
+ end
154
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
155
+
79
156
  arguments = arguments.clone
80
157
  headers = arguments.delete(:headers) || {}
81
158
 
@@ -97,7 +174,7 @@ module ElasticsearchServerless
97
174
  params = Utils.process_params(arguments)
98
175
 
99
176
  ElasticsearchServerless::API::Response.new(
100
- perform_request(method, path, params, body, headers)
177
+ perform_request(method, path, params, body, headers, request_opts)
101
178
  )
102
179
  end
103
180
  end
@@ -34,6 +34,14 @@ module ElasticsearchServerless
34
34
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-search-application.html
35
35
  #
36
36
  def delete(arguments = {})
37
+ request_opts = { endpoint: arguments[:endpoint] || "search_application.delete" }
38
+
39
+ defined_params = [:name].inject({}) do |set_variables, variable|
40
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
+ set_variables
42
+ end
43
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
44
+
37
45
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
38
46
 
39
47
  arguments = arguments.clone
@@ -48,7 +56,7 @@ module ElasticsearchServerless
48
56
  params = {}
49
57
 
50
58
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
59
+ perform_request(method, path, params, body, headers, request_opts)
52
60
  )
53
61
  end
54
62
  end
@@ -34,6 +34,14 @@ module ElasticsearchServerless
34
34
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-analytics-collection.html
35
35
  #
36
36
  def delete_behavioral_analytics(arguments = {})
37
+ request_opts = { endpoint: arguments[:endpoint] || "search_application.delete_behavioral_analytics" }
38
+
39
+ defined_params = [:name].inject({}) do |set_variables, variable|
40
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
+ set_variables
42
+ end
43
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
44
+
37
45
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
38
46
 
39
47
  arguments = arguments.clone
@@ -48,7 +56,7 @@ module ElasticsearchServerless
48
56
  params = {}
49
57
 
50
58
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
59
+ perform_request(method, path, params, body, headers, request_opts)
52
60
  )
53
61
  end
54
62
  end
@@ -34,6 +34,14 @@ module ElasticsearchServerless
34
34
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-search-application.html
35
35
  #
36
36
  def get(arguments = {})
37
+ request_opts = { endpoint: arguments[:endpoint] || "search_application.get" }
38
+
39
+ defined_params = [:name].inject({}) do |set_variables, variable|
40
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
+ set_variables
42
+ end
43
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
44
+
37
45
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
38
46
 
39
47
  arguments = arguments.clone
@@ -48,7 +56,7 @@ module ElasticsearchServerless
48
56
  params = {}
49
57
 
50
58
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
59
+ perform_request(method, path, params, body, headers, request_opts)
52
60
  )
53
61
  end
54
62
  end
@@ -34,6 +34,14 @@ module ElasticsearchServerless
34
34
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-analytics-collection.html
35
35
  #
36
36
  def get_behavioral_analytics(arguments = {})
37
+ request_opts = { endpoint: arguments[:endpoint] || "search_application.get_behavioral_analytics" }
38
+
39
+ defined_params = [:name].inject({}) do |set_variables, variable|
40
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
+ set_variables
42
+ end
43
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
44
+
37
45
  arguments = arguments.clone
38
46
  headers = arguments.delete(:headers) || {}
39
47
 
@@ -50,7 +58,7 @@ module ElasticsearchServerless
50
58
  params = {}
51
59
 
52
60
  ElasticsearchServerless::API::Response.new(
53
- perform_request(method, path, params, body, headers)
61
+ perform_request(method, path, params, body, headers, request_opts)
54
62
  )
55
63
  end
56
64
  end
@@ -36,6 +36,8 @@ module ElasticsearchServerless
36
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-search-applications.html
37
37
  #
38
38
  def list(arguments = {})
39
+ request_opts = { endpoint: arguments[:endpoint] || "search_application.list" }
40
+
39
41
  arguments = arguments.clone
40
42
  headers = arguments.delete(:headers) || {}
41
43
 
@@ -46,7 +48,7 @@ module ElasticsearchServerless
46
48
  params = Utils.process_params(arguments)
47
49
 
48
50
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
51
+ perform_request(method, path, params, body, headers, request_opts)
50
52
  )
51
53
  end
52
54
  end
@@ -36,6 +36,14 @@ module ElasticsearchServerless
36
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-search-application.html
37
37
  #
38
38
  def put(arguments = {})
39
+ request_opts = { endpoint: arguments[:endpoint] || "search_application.put" }
40
+
41
+ defined_params = [:name].inject({}) do |set_variables, variable|
42
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
+ set_variables
44
+ end
45
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
46
+
39
47
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
40
48
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
41
49
 
@@ -51,7 +59,7 @@ module ElasticsearchServerless
51
59
  params = Utils.process_params(arguments)
52
60
 
53
61
  ElasticsearchServerless::API::Response.new(
54
- perform_request(method, path, params, body, headers)
62
+ perform_request(method, path, params, body, headers, request_opts)
55
63
  )
56
64
  end
57
65
  end
@@ -34,6 +34,14 @@ module ElasticsearchServerless
34
34
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-analytics-collection.html
35
35
  #
36
36
  def put_behavioral_analytics(arguments = {})
37
+ request_opts = { endpoint: arguments[:endpoint] || "search_application.put_behavioral_analytics" }
38
+
39
+ defined_params = [:name].inject({}) do |set_variables, variable|
40
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
41
+ set_variables
42
+ end
43
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
44
+
37
45
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
38
46
 
39
47
  arguments = arguments.clone
@@ -48,7 +56,7 @@ module ElasticsearchServerless
48
56
  params = {}
49
57
 
50
58
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
59
+ perform_request(method, path, params, body, headers, request_opts)
52
60
  )
53
61
  end
54
62
  end
@@ -36,6 +36,14 @@ module ElasticsearchServerless
36
36
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-application-search.html
37
37
  #
38
38
  def search(arguments = {})
39
+ request_opts = { endpoint: arguments[:endpoint] || "search_application.search" }
40
+
41
+ defined_params = [:name].inject({}) do |set_variables, variable|
42
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
+ set_variables
44
+ end
45
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
46
+
39
47
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
40
48
 
41
49
  arguments = arguments.clone
@@ -55,7 +63,7 @@ module ElasticsearchServerless
55
63
  params = Utils.process_params(arguments)
56
64
 
57
65
  ElasticsearchServerless::API::Response.new(
58
- perform_request(method, path, params, body, headers)
66
+ perform_request(method, path, params, body, headers, request_opts)
59
67
  )
60
68
  end
61
69
  end
@@ -21,26 +21,46 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
- # Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile.
24
+ # Search a vector tile.
25
+ # Searches a vector tile for geospatial values.
25
26
  #
26
27
  # @option arguments [String, Array] :index Comma-separated list of data streams, indices, or aliases to search (*Required*)
27
28
  # @option arguments [String] :field Field containing geospatial data to return (*Required*)
28
29
  # @option arguments [Integer] :zoom Zoom level for the vector tile to search (*Required*)
29
30
  # @option arguments [Integer] :x X coordinate for the vector tile to search (*Required*)
30
31
  # @option arguments [Integer] :y Y coordinate for the vector tile to search (*Required*)
31
- # @option arguments [Boolean] :exact_bounds If false, the meta layer’s feature is the bounding box of the tile. If true, the meta layer’s feature is a bounding box resulting from a geo_bounds aggregation. The aggregation runs on <field> values that intersect the <zoom>/<x>/<y> tile with wrap_longitude set to false. The resulting bounding box may be larger than the vector tile.
32
+ # @option arguments [Boolean] :exact_bounds If false, the meta layer’s feature is the bounding box of the tile.
33
+ # If true, the meta layer’s feature is a bounding box resulting from a
34
+ # geo_bounds aggregation. The aggregation runs on <field> values that intersect
35
+ # the <zoom>/<x>/<y> tile with wrap_longitude set to false. The resulting
36
+ # bounding box may be larger than the vector tile.
32
37
  # @option arguments [Integer] :extent Size, in pixels, of a side of the tile. Vector tiles are square with equal sides. Server default: 4096.
33
38
  # @option arguments [String] :grid_agg Aggregation used to create a grid for +field+.
34
- # @option arguments [Integer] :grid_precision Additional zoom levels available through the aggs layer. For example, if <zoom> is 7 and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results don’t include the aggs layer. Server default: 8.
35
- # @option arguments [String] :grid_type Determines the geometry type for features in the aggs layer. In the aggs layer, each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon of the cells bounding box. If 'point' each feature is a Point that is the centroid of the cell. Server default: grid.
36
- # @option arguments [Integer] :size Maximum number of features to return in the hits layer. Accepts 0-10000. If 0, results don’t include the hits layer. Server default: 10000.
37
- # @option arguments [Boolean] :with_labels If +true+, the hits and aggs layers will contain additional point features representing suggested label positions for the original features.
39
+ # @option arguments [Integer] :grid_precision Additional zoom levels available through the aggs layer. For example, if <zoom> is 7
40
+ # and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results
41
+ # don’t include the aggs layer. Server default: 8.
42
+ # @option arguments [String] :grid_type Determines the geometry type for features in the aggs layer. In the aggs layer,
43
+ # each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon
44
+ # of the cells bounding box. If 'point' each feature is a Point that is the centroid
45
+ # of the cell. Server default: grid.
46
+ # @option arguments [Integer] :size Maximum number of features to return in the hits layer. Accepts 0-10000.
47
+ # If 0, results don’t include the hits layer. Server default: 10000.
48
+ # @option arguments [Boolean] :with_labels If +true+, the hits and aggs layers will contain additional point features representing
49
+ # suggested label positions for the original features.
38
50
  # @option arguments [Hash] :headers Custom HTTP headers
39
51
  # @option arguments [Hash] :body request body
40
52
  #
41
53
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html
42
54
  #
43
55
  def search_mvt(arguments = {})
56
+ request_opts = { endpoint: arguments[:endpoint] || "search_mvt" }
57
+
58
+ defined_params = [:index, :field, :zoom, :x, :y].inject({}) do |set_variables, variable|
59
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
60
+ set_variables
61
+ end
62
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
63
+
44
64
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
45
65
  raise ArgumentError, "Required argument 'field' missing" unless arguments[:field]
46
66
  raise ArgumentError, "Required argument 'zoom' missing" unless arguments[:zoom]
@@ -67,7 +87,7 @@ module ElasticsearchServerless
67
87
  params = Utils.process_params(arguments)
68
88
 
69
89
  ElasticsearchServerless::API::Response.new(
70
- perform_request(method, path, params, body, headers)
90
+ perform_request(method, path, params, body, headers, request_opts)
71
91
  )
72
92
  end
73
93
  end
@@ -23,17 +23,25 @@ module ElasticsearchServerless
23
23
  module Actions
24
24
  # Runs a search with a search template.
25
25
  #
26
- # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*).
27
- # @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. This behavior applies even if the request targets other open indices. 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.
26
+ # @option arguments [String, Array] :index Comma-separated list of data streams, indices,
27
+ # and aliases to search. Supports wildcards (*).
28
+ # @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.
29
+ # This behavior applies even if the request targets other open indices.
30
+ # 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.
28
31
  # @option arguments [Boolean] :ccs_minimize_roundtrips If +true+, network round-trips are minimized for cross-cluster search requests.
29
- # @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+. Valid values are: +all+, +open+, +closed+, +hidden+, +none+.
32
+ # @option arguments [String, Array<String>] :expand_wildcards Type of index that wildcard patterns can match.
33
+ # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
34
+ # Supports comma-separated values, such as +open,hidden+.
35
+ # Valid values are: +all+, +open+, +closed+, +hidden+, +none+.
30
36
  # @option arguments [Boolean] :explain If +true+, the response includes additional details about score computation as part of a hit.
31
37
  # @option arguments [Boolean] :ignore_throttled If +true+, specified concrete, expanded, or aliased indices are not included in the response when throttled. Server default: true.
32
38
  # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
33
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
39
+ # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
40
+ # Random by default.
34
41
  # @option arguments [Boolean] :profile If +true+, the query execution is profiled.
35
42
  # @option arguments [String] :routing Custom value used to route operations to a specific shard.
36
- # @option arguments [Time] :scroll Specifies how long a consistent view of the index should be maintained for scrolled search.
43
+ # @option arguments [Time] :scroll Specifies how long a consistent view of the index
44
+ # should be maintained for scrolled search.
37
45
  # @option arguments [String] :search_type The type of the search operation.
38
46
  # @option arguments [Boolean] :rest_total_hits_as_int If true, hits.total are rendered as an integer in the response.
39
47
  # @option arguments [Boolean] :typed_keys If +true+, the response prefixes aggregation and suggester names with their respective types.
@@ -43,6 +51,14 @@ module ElasticsearchServerless
43
51
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html
44
52
  #
45
53
  def search_template(arguments = {})
54
+ request_opts = { endpoint: arguments[:endpoint] || "search_template" }
55
+
56
+ defined_params = [:index].inject({}) do |set_variables, variable|
57
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
58
+ set_variables
59
+ end
60
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
61
+
46
62
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
47
63
 
48
64
  arguments = arguments.clone
@@ -61,7 +77,7 @@ module ElasticsearchServerless
61
77
  params = Utils.process_params(arguments)
62
78
 
63
79
  ElasticsearchServerless::API::Response.new(
64
- perform_request(method, path, params, body, headers)
80
+ perform_request(method, path, params, body, headers, request_opts)
65
81
  )
66
82
  end
67
83
  end
@@ -22,7 +22,9 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Security
24
24
  module Actions
25
- # Enables you to submit a request with a basic auth header to authenticate a user and retrieve information about the authenticated user.
25
+ # Authenticate a user.
26
+ # Authenticates a user and returns information about the authenticated user.
27
+ # Include the user information in a {https://en.wikipedia.org/wiki/Basic_access_authentication basic auth header}.
26
28
  # A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user.
27
29
  # If the user cannot be authenticated, this API returns a 401 status code.
28
30
  #
@@ -31,6 +33,8 @@ module ElasticsearchServerless
31
33
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html
32
34
  #
33
35
  def authenticate(arguments = {})
36
+ request_opts = { endpoint: arguments[:endpoint] || "security.authenticate" }
37
+
34
38
  arguments = arguments.clone
35
39
  headers = arguments.delete(:headers) || {}
36
40
 
@@ -41,7 +45,7 @@ module ElasticsearchServerless
41
45
  params = {}
42
46
 
43
47
  ElasticsearchServerless::API::Response.new(
44
- perform_request(method, path, params, body, headers)
48
+ perform_request(method, path, params, body, headers, request_opts)
45
49
  )
46
50
  end
47
51
  end
@@ -22,6 +22,7 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Security
24
24
  module Actions
25
+ # Create an API key.
25
26
  # Creates an API key for access without requiring basic authentication.
26
27
  # A successful request returns a JSON structure that contains the API key, its unique id, and its name.
27
28
  # If applicable, it also returns expiration information for the API key in milliseconds.
@@ -34,6 +35,8 @@ module ElasticsearchServerless
34
35
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
35
36
  #
36
37
  def create_api_key(arguments = {})
38
+ request_opts = { endpoint: arguments[:endpoint] || "security.create_api_key" }
39
+
37
40
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
38
41
 
39
42
  arguments = arguments.clone
@@ -46,7 +49,7 @@ module ElasticsearchServerless
46
49
  params = Utils.process_params(arguments)
47
50
 
48
51
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
52
+ perform_request(method, path, params, body, headers, request_opts)
50
53
  )
51
54
  end
52
55
  end