elasticsearch-serverless 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch-serverless/api/async_search/delete.rb +3 -4
  3. data/lib/elasticsearch-serverless/api/async_search/get.rb +4 -5
  4. data/lib/elasticsearch-serverless/api/async_search/status.rb +11 -8
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +6 -10
  6. data/lib/elasticsearch-serverless/api/bulk.rb +109 -22
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +17 -18
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +17 -16
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +13 -18
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +5 -19
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +10 -15
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +7 -17
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +6 -16
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +6 -16
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +7 -16
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +6 -16
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +9 -7
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +8 -4
  19. data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +3 -5
  20. data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +4 -5
  21. data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +5 -6
  22. data/lib/elasticsearch-serverless/api/cluster/info.rb +3 -4
  23. data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +6 -5
  24. data/lib/elasticsearch-serverless/api/connector/check_in.rb +3 -4
  25. data/lib/elasticsearch-serverless/api/connector/delete.rb +4 -4
  26. data/lib/elasticsearch-serverless/api/connector/get.rb +5 -5
  27. data/lib/elasticsearch-serverless/api/connector/list.rb +4 -3
  28. data/lib/elasticsearch-serverless/api/connector/post.rb +3 -3
  29. data/lib/elasticsearch-serverless/api/connector/put.rb +4 -5
  30. data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +7 -6
  31. data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +7 -6
  32. data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +7 -6
  33. data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +3 -3
  34. data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +3 -3
  35. data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +3 -4
  36. data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +3 -4
  37. data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +3 -4
  38. data/lib/elasticsearch-serverless/api/connector/update_error.rb +3 -4
  39. data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +3 -4
  40. data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +2 -3
  41. data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +3 -4
  42. data/lib/elasticsearch-serverless/api/connector/update_name.rb +3 -4
  43. data/lib/elasticsearch-serverless/api/connector/update_native.rb +2 -3
  44. data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +3 -4
  45. data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +3 -4
  46. data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +3 -4
  47. data/lib/elasticsearch-serverless/api/connector/update_status.rb +3 -4
  48. data/lib/elasticsearch-serverless/api/count.rb +36 -25
  49. data/lib/elasticsearch-serverless/api/create.rb +77 -22
  50. data/lib/elasticsearch-serverless/api/delete.rb +44 -18
  51. data/lib/elasticsearch-serverless/api/delete_by_query.rb +91 -29
  52. data/lib/elasticsearch-serverless/api/delete_script.rb +10 -9
  53. data/lib/elasticsearch-serverless/api/enrich/delete_policy.rb +5 -5
  54. data/lib/elasticsearch-serverless/api/enrich/execute_policy.rb +6 -5
  55. data/lib/elasticsearch-serverless/api/enrich/get_policy.rb +6 -6
  56. data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +5 -5
  57. data/lib/elasticsearch-serverless/api/eql/delete.rb +5 -5
  58. data/lib/elasticsearch-serverless/api/eql/get.rb +5 -5
  59. data/lib/elasticsearch-serverless/api/eql/get_status.rb +5 -5
  60. data/lib/elasticsearch-serverless/api/eql/search.rb +9 -5
  61. data/lib/elasticsearch-serverless/api/exists.rb +38 -19
  62. data/lib/elasticsearch-serverless/api/exists_source.rb +23 -18
  63. data/lib/elasticsearch-serverless/api/explain.rb +25 -16
  64. data/lib/elasticsearch-serverless/api/field_caps.rb +16 -13
  65. data/lib/elasticsearch-serverless/api/get.rb +71 -21
  66. data/lib/elasticsearch-serverless/api/get_script.rb +7 -6
  67. data/lib/elasticsearch-serverless/api/get_source.rb +25 -15
  68. data/lib/elasticsearch-serverless/api/graph/explore.rb +9 -5
  69. data/lib/elasticsearch-serverless/api/index.rb +110 -21
  70. data/lib/elasticsearch-serverless/api/indices/add_block.rb +23 -12
  71. data/lib/elasticsearch-serverless/api/indices/analyze.rb +9 -6
  72. data/lib/elasticsearch-serverless/api/indices/create.rb +19 -6
  73. data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +3 -5
  74. data/lib/elasticsearch-serverless/api/indices/delete.rb +11 -8
  75. data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +4 -7
  76. data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +3 -4
  77. data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +3 -4
  78. data/lib/elasticsearch-serverless/api/indices/exists.rb +7 -8
  79. data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +8 -8
  80. data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +6 -6
  81. data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +4 -5
  82. data/lib/elasticsearch-serverless/api/indices/get.rb +5 -6
  83. data/lib/elasticsearch-serverless/api/indices/get_alias.rb +6 -6
  84. data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +4 -5
  85. data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +5 -6
  86. data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +5 -6
  87. data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +4 -6
  88. data/lib/elasticsearch-serverless/api/indices/get_settings.rb +6 -7
  89. data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +3 -4
  90. data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +3 -3
  91. data/lib/elasticsearch-serverless/api/indices/put_alias.rb +4 -7
  92. data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +4 -6
  93. data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +22 -4
  94. data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +21 -6
  95. data/lib/elasticsearch-serverless/api/indices/put_settings.rb +17 -7
  96. data/lib/elasticsearch-serverless/api/indices/refresh.rb +11 -5
  97. data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +5 -5
  98. data/lib/elasticsearch-serverless/api/indices/rollover.rb +28 -5
  99. data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +4 -5
  100. data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +5 -6
  101. data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +3 -3
  102. data/lib/elasticsearch-serverless/api/indices/validate_query.rb +4 -5
  103. data/lib/elasticsearch-serverless/api/inference/chat_completion_unified.rb +62 -0
  104. data/lib/elasticsearch-serverless/api/inference/completion.rb +62 -0
  105. data/lib/elasticsearch-serverless/api/inference/delete.rb +6 -11
  106. data/lib/elasticsearch-serverless/api/inference/get.rb +4 -9
  107. data/lib/elasticsearch-serverless/api/inference/inference.rb +0 -4
  108. data/lib/elasticsearch-serverless/api/inference/put.rb +12 -9
  109. data/lib/elasticsearch-serverless/api/inference/put_watsonx.rb +78 -0
  110. data/lib/elasticsearch-serverless/api/inference/rerank.rb +62 -0
  111. data/lib/elasticsearch-serverless/api/inference/sparse_embedding.rb +62 -0
  112. data/lib/elasticsearch-serverless/api/inference/text_embedding.rb +62 -0
  113. data/lib/elasticsearch-serverless/api/info.rb +4 -4
  114. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +5 -5
  115. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +6 -6
  116. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +5 -4
  117. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +3 -4
  118. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +9 -8
  119. data/lib/elasticsearch-serverless/api/license/get.rb +4 -5
  120. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +7 -6
  121. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +7 -7
  122. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +7 -6
  123. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +3 -4
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +4 -5
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +3 -4
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +3 -4
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +3 -4
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +3 -4
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +3 -4
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +3 -4
  131. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +4 -4
  132. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +3 -4
  133. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +5 -5
  134. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +3 -3
  135. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +3 -4
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +3 -4
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +4 -5
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +4 -5
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +4 -5
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +4 -5
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +4 -5
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +4 -5
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +4 -5
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +4 -5
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +3 -4
  146. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +4 -5
  147. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +4 -5
  148. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +3 -9
  149. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +3 -4
  150. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +3 -4
  151. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +5 -6
  152. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +4 -5
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +3 -4
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +3 -4
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +6 -4
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +6 -6
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +3 -4
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +16 -5
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +3 -4
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +3 -4
  161. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +3 -4
  162. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +3 -4
  163. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +3 -4
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +3 -4
  165. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +3 -4
  166. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +7 -6
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +3 -4
  168. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +3 -4
  169. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +3 -4
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +3 -4
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +3 -4
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +3 -4
  173. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +3 -4
  174. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +3 -4
  175. data/lib/elasticsearch-serverless/api/mget.rb +12 -5
  176. data/lib/elasticsearch-serverless/api/msearch.rb +16 -17
  177. data/lib/elasticsearch-serverless/api/msearch_template.rb +23 -16
  178. data/lib/elasticsearch-serverless/api/mtermvectors.rb +15 -12
  179. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +33 -11
  180. data/lib/elasticsearch-serverless/api/ping.rb +8 -10
  181. data/lib/elasticsearch-serverless/api/put_script.rb +12 -11
  182. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +6 -5
  183. data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +6 -5
  184. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +5 -5
  185. data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +5 -5
  186. data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +7 -6
  187. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +11 -7
  188. data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +11 -6
  189. data/lib/elasticsearch-serverless/api/query_rules/test.rb +5 -5
  190. data/lib/elasticsearch-serverless/api/rank_eval.rb +8 -7
  191. data/lib/elasticsearch-serverless/api/reindex.rb +146 -9
  192. data/lib/elasticsearch-serverless/api/render_search_template.rb +7 -7
  193. data/lib/elasticsearch-serverless/api/response.rb +1 -1
  194. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +7 -3
  195. data/lib/elasticsearch-serverless/api/scroll.rb +4 -4
  196. data/lib/elasticsearch-serverless/api/search.rb +79 -72
  197. data/lib/elasticsearch-serverless/api/search_application/delete.rb +4 -5
  198. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +3 -4
  199. data/lib/elasticsearch-serverless/api/search_application/get.rb +3 -4
  200. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +4 -5
  201. data/lib/elasticsearch-serverless/api/search_application/list.rb +5 -4
  202. data/lib/elasticsearch-serverless/api/search_application/put.rb +3 -4
  203. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +3 -4
  204. data/lib/elasticsearch-serverless/api/search_application/search.rb +3 -4
  205. data/lib/elasticsearch-serverless/api/search_mvt.rb +132 -10
  206. data/lib/elasticsearch-serverless/api/search_template.rb +13 -13
  207. data/lib/elasticsearch-serverless/api/security/authenticate.rb +3 -3
  208. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +7 -3
  209. data/lib/elasticsearch-serverless/api/security/delete_role.rb +6 -5
  210. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +3 -3
  211. data/lib/elasticsearch-serverless/api/security/get_builtin_privileges.rb +3 -3
  212. data/lib/elasticsearch-serverless/api/security/get_role.rb +11 -8
  213. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +6 -5
  214. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +8 -6
  215. data/lib/elasticsearch-serverless/api/security/put_role.rb +3 -4
  216. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +12 -6
  217. data/lib/elasticsearch-serverless/api/security/query_role.rb +61 -0
  218. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +74 -0
  219. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +4 -4
  220. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +10 -6
  221. data/lib/elasticsearch-serverless/api/sql/get_async.rb +16 -13
  222. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +6 -6
  223. data/lib/elasticsearch-serverless/api/sql/query.rb +8 -5
  224. data/lib/elasticsearch-serverless/api/sql/translate.rb +6 -4
  225. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +17 -6
  226. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +7 -7
  227. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +7 -8
  228. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +7 -7
  229. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +7 -6
  230. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -6
  231. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -7
  232. data/lib/elasticsearch-serverless/api/tasks/get.rb +9 -7
  233. data/lib/elasticsearch-serverless/api/terms_enum.rb +7 -9
  234. data/lib/elasticsearch-serverless/api/termvectors.rb +40 -17
  235. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +3 -5
  236. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +5 -6
  237. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +4 -5
  238. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +4 -5
  239. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +3 -4
  240. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +4 -5
  241. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +7 -8
  242. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +3 -5
  243. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +3 -4
  244. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +3 -4
  245. data/lib/elasticsearch-serverless/api/update.rb +36 -24
  246. data/lib/elasticsearch-serverless/api/update_by_query.rb +102 -31
  247. data/lib/elasticsearch-serverless/api.rb +22 -25
  248. data/lib/elasticsearch-serverless/version.rb +1 -1
  249. data/lib/elasticsearch-serverless.rb +7 -0
  250. metadata +18 -7
@@ -22,34 +22,57 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Get term vector information.
25
- # Returns information and statistics about terms in the fields of a particular document.
25
+ # Get information and statistics about terms in the fields of a particular document.
26
+ # You can retrieve term vectors for documents stored in the index or for artificial documents passed in the body of the request.
27
+ # You can specify the fields you are interested in through the +fields+ parameter or by adding the fields to the request body.
28
+ # For example:
29
+ # +
30
+ # GET /my-index-000001/_termvectors/1?fields=message
31
+ # +
32
+ # Fields can be specified using wildcards, similar to the multi match query.
33
+ # Term vectors are real-time by default, not near real-time.
34
+ # This can be changed by setting +realtime+ parameter to +false+.
35
+ # You can request three types of values: _term information_, _term statistics_, and _field statistics_.
36
+ # By default, all term information and field statistics are returned for all fields but term statistics are excluded.
37
+ # **Term information**
38
+ # * term frequency in the field (always returned)
39
+ # * term positions (+positions: true+)
40
+ # * start and end offsets (+offsets: true+)
41
+ # * term payloads (+payloads: true+), as base64 encoded bytes
42
+ # If the requested information wasn't stored in the index, it will be computed on the fly if possible.
43
+ # Additionally, term vectors could be computed for documents not even existing in the index, but instead provided by the user.
26
44
  #
27
- # @option arguments [String] :index Name of the index that contains the document. (*Required*)
28
- # @option arguments [String] :id Unique identifier of the document.
29
- # @option arguments [String, Array<String>] :fields Comma-separated list or wildcard expressions of fields to include in the statistics.
30
- # Used as the default list unless a specific field list is provided in the +completion_fields+ or +fielddata_fields+ parameters.
31
- # @option arguments [Boolean] :field_statistics If +true+, the response includes the document count, sum of document frequencies, and sum of total term frequencies. Server default: true.
45
+ # @option arguments [String] :index The name of the index that contains the document. (*Required*)
46
+ # @option arguments [String] :id A unique identifier for the document.
47
+ # @option arguments [String, Array<String>] :fields A comma-separated list or wildcard expressions of fields to include in the statistics.
48
+ # It is used as the default list unless a specific field list is provided in the +completion_fields+ or +fielddata_fields+ parameters.
49
+ # @option arguments [Boolean] :field_statistics If +true+, the response includes:
50
+ # - The document count (how many documents contain this field).
51
+ # - The sum of document frequencies (the sum of document frequencies for all terms in this field).
52
+ # - The sum of total term frequencies (the sum of total term frequencies of each term in this field). Server default: true.
32
53
  # @option arguments [Boolean] :offsets If +true+, the response includes term offsets. Server default: true.
33
54
  # @option arguments [Boolean] :payloads If +true+, the response includes term payloads. Server default: true.
34
55
  # @option arguments [Boolean] :positions If +true+, the response includes term positions. Server default: true.
35
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
36
- # Random by default.
56
+ # @option arguments [String] :preference The node or shard the operation should be performed on.
57
+ # It is random by default.
37
58
  # @option arguments [Boolean] :realtime If true, the request is real-time as opposed to near-real-time. Server default: true.
38
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
39
- # @option arguments [Boolean] :term_statistics If +true+, the response includes term frequency and document frequency.
59
+ # @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
60
+ # @option arguments [Boolean] :term_statistics If +true+, the response includes:
61
+ # - The total term frequency (how often a term occurs in all documents).
62
+ # - The document frequency (the number of documents containing the current term).
63
+ # By default these values are not returned since term statistics can have a serious performance impact.
40
64
  # @option arguments [Integer] :version If +true+, returns the document version as part of a hit.
41
- # @option arguments [String] :version_type Specific version type.
65
+ # @option arguments [String] :version_type The version type.
42
66
  # @option arguments [Hash] :headers Custom HTTP headers
43
67
  # @option arguments [Hash] :body request body
44
68
  #
45
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html
69
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-termvectors
46
70
  #
47
71
  def termvectors(arguments = {})
48
- request_opts = { endpoint: arguments[:endpoint] || "termvectors" }
72
+ request_opts = { endpoint: arguments[:endpoint] || 'termvectors' }
49
73
 
50
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
74
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
51
75
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
- set_variables
53
76
  end
54
77
  request_opts[:defined_params] = defined_params unless defined_params.empty?
55
78
 
@@ -86,8 +109,8 @@ module ElasticsearchServerless
86
109
  # Deprecated: Use the plural version, {#termvectors}
87
110
  #
88
111
  def termvector(arguments = {})
89
- warn "[DEPRECATION] `termvector` is deprecated. Please use the plural version, `termvectors` instead."
90
- termvectors(arguments.merge endpoint: '_termvector')
112
+ warn '[DEPRECATION] `termvector` is deprecated. Please use the plural version, `termvectors` instead.'
113
+ termvectors(arguments.merge(endpoint: '_termvector'))
91
114
  end
92
115
  end
93
116
  end
@@ -23,7 +23,6 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Delete a transform.
26
- # Deletes a transform.
27
26
  #
28
27
  # @option arguments [String] :transform_id Identifier for the transform. (*Required*)
29
28
  # @option arguments [Boolean] :force If this value is false, the transform must be stopped before it can be deleted. If true, the transform is
@@ -33,14 +32,13 @@ module ElasticsearchServerless
33
32
  # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
34
33
  # @option arguments [Hash] :headers Custom HTTP headers
35
34
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html
35
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-delete-transform
37
36
  #
38
37
  def delete_transform(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "transform.delete_transform" }
38
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.delete_transform' }
40
39
 
41
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
40
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
42
41
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
42
  end
45
43
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
44
 
@@ -23,7 +23,7 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Get transforms.
26
- # Retrieves configuration information for transforms.
26
+ # Get configuration information for transforms.
27
27
  #
28
28
  # @option arguments [String, Array<String>] :transform_id Identifier for the transform. It can be a transform identifier or a
29
29
  # wildcard expression. You can get information for all transforms by using
@@ -42,14 +42,13 @@ module ElasticsearchServerless
42
42
  # be retrieved and then added to another cluster.
43
43
  # @option arguments [Hash] :headers Custom HTTP headers
44
44
  #
45
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform
46
46
  #
47
47
  def get_transform(arguments = {})
48
- request_opts = { endpoint: arguments[:endpoint] || "transform.get_transform" }
48
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.get_transform' }
49
49
 
50
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
50
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
51
51
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
- set_variables
53
52
  end
54
53
  request_opts[:defined_params] = defined_params unless defined_params.empty?
55
54
 
@@ -64,7 +63,7 @@ module ElasticsearchServerless
64
63
  path = if _transform_id
65
64
  "_transform/#{Utils.listify(_transform_id)}"
66
65
  else
67
- "_transform"
66
+ '_transform'
68
67
  end
69
68
  params = Utils.process_params(arguments)
70
69
 
@@ -23,7 +23,7 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Get transform stats.
26
- # Retrieves usage information for transforms.
26
+ # Get usage information for transforms.
27
27
  #
28
28
  # @option arguments [String, Array<String>] :transform_id Identifier for the transform. It can be a transform identifier or a
29
29
  # wildcard expression. You can get information for all transforms by using
@@ -40,14 +40,13 @@ module ElasticsearchServerless
40
40
  # @option arguments [Time] :timeout Controls the time to wait for the stats
41
41
  # @option arguments [Hash] :headers Custom HTTP headers
42
42
  #
43
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html
43
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform-stats
44
44
  #
45
45
  def get_transform_stats(arguments = {})
46
- request_opts = { endpoint: arguments[:endpoint] || "transform.get_transform_stats" }
46
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.get_transform_stats' }
47
47
 
48
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
48
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
49
49
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
50
- set_variables
51
50
  end
52
51
  request_opts[:defined_params] = defined_params unless defined_params.empty?
53
52
 
@@ -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/current/preview-transform.html
38
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-preview-transform
39
39
  #
40
40
  def preview_transform(arguments = {})
41
- request_opts = { endpoint: arguments[:endpoint] || "transform.preview_transform" }
41
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.preview_transform' }
42
42
 
43
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
43
+ defined_params = [:transform_id].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
 
@@ -62,7 +61,7 @@ module ElasticsearchServerless
62
61
  path = if _transform_id
63
62
  "_transform/#{Utils.listify(_transform_id)}/_preview"
64
63
  else
65
- "_transform/_preview"
64
+ '_transform/_preview'
66
65
  end
67
66
  params = Utils.process_params(arguments)
68
67
 
@@ -52,14 +52,13 @@ module ElasticsearchServerless
52
52
  # @option arguments [Hash] :headers Custom HTTP headers
53
53
  # @option arguments [Hash] :body request body
54
54
  #
55
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html
55
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-put-transform
56
56
  #
57
57
  def put_transform(arguments = {})
58
- request_opts = { endpoint: arguments[:endpoint] || "transform.put_transform" }
58
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.put_transform' }
59
59
 
60
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
60
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
61
61
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
62
- set_variables
63
62
  end
64
63
  request_opts[:defined_params] = defined_params unless defined_params.empty?
65
64
 
@@ -23,7 +23,6 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Reset a transform.
26
- # Resets a transform.
27
26
  # Before you can reset it, you must stop it; alternatively, use the +force+ query parameter.
28
27
  # If the destination index was created by the transform, it is deleted.
29
28
  #
@@ -31,16 +30,16 @@ module ElasticsearchServerless
31
30
  # hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (*Required*)
32
31
  # @option arguments [Boolean] :force If this value is +true+, the transform is reset regardless of its current state. If it's +false+, the transform
33
32
  # must be stopped before it can be reset.
33
+ # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
34
34
  # @option arguments [Hash] :headers Custom HTTP headers
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-reset-transform
37
37
  #
38
38
  def reset_transform(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "transform.reset_transform" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.reset_transform' }
40
40
 
41
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
@@ -23,24 +23,23 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Schedule a transform to start now.
26
- # Instantly runs a transform to process data.
27
- # If you _schedule_now a transform, it will process the new data instantly,
28
- # without waiting for the configured frequency interval. After _schedule_now API is called,
29
- # the transform will be processed again at now + frequency unless _schedule_now API
26
+ # Instantly run a transform to process data.
27
+ # If you run this API, the transform will process the new data instantly,
28
+ # without waiting for the configured frequency interval. After the API is called,
29
+ # the transform will be processed again at +now + frequency+ unless the API
30
30
  # is called again in the meantime.
31
31
  #
32
32
  # @option arguments [String] :transform_id Identifier for the transform. (*Required*)
33
33
  # @option arguments [Time] :timeout Controls the time to wait for the scheduling to take place Server default: 30s.
34
34
  # @option arguments [Hash] :headers Custom HTTP headers
35
35
  #
36
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html
36
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-schedule-now-transform
37
37
  #
38
38
  def schedule_now_transform(arguments = {})
39
- request_opts = { endpoint: arguments[:endpoint] || "transform.schedule_now_transform" }
39
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.schedule_now_transform' }
40
40
 
41
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
41
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
42
42
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
43
- set_variables
44
43
  end
45
44
  request_opts[:defined_params] = defined_params unless defined_params.empty?
46
45
 
@@ -23,7 +23,6 @@ module ElasticsearchServerless
23
23
  module Transform
24
24
  module Actions
25
25
  # Start a transform.
26
- # Starts a transform.
27
26
  # When you start a transform, it creates the destination index if it does not already exist. The +number_of_shards+ is
28
27
  # set to +1+ and the +auto_expand_replicas+ is set to +0-1+. If it is a pivot transform, it deduces the mapping
29
28
  # definitions for the destination index from the source indices and the transform aggregations. If fields in the
@@ -43,14 +42,13 @@ module ElasticsearchServerless
43
42
  # @option arguments [String] :from Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms.
44
43
  # @option arguments [Hash] :headers Custom HTTP headers
45
44
  #
46
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-start-transform
47
46
  #
48
47
  def start_transform(arguments = {})
49
- request_opts = { endpoint: arguments[:endpoint] || "transform.start_transform" }
48
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.start_transform' }
50
49
 
51
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
50
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
52
51
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
53
- set_variables
54
52
  end
55
53
  request_opts[:defined_params] = defined_params unless defined_params.empty?
56
54
 
@@ -41,14 +41,13 @@ module ElasticsearchServerless
41
41
  # immediately and the indexer is stopped asynchronously in the background.
42
42
  # @option arguments [Hash] :headers Custom HTTP headers
43
43
  #
44
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html
44
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform
45
45
  #
46
46
  def stop_transform(arguments = {})
47
- request_opts = { endpoint: arguments[:endpoint] || "transform.stop_transform" }
47
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.stop_transform' }
48
48
 
49
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
49
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
50
50
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
51
- set_variables
52
51
  end
53
52
  request_opts[:defined_params] = defined_params unless defined_params.empty?
54
53
 
@@ -39,14 +39,13 @@ module ElasticsearchServerless
39
39
  # @option arguments [Hash] :headers Custom HTTP headers
40
40
  # @option arguments [Hash] :body request body
41
41
  #
42
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html
42
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-update-transform
43
43
  #
44
44
  def update_transform(arguments = {})
45
- request_opts = { endpoint: arguments[:endpoint] || "transform.update_transform" }
45
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.update_transform' }
46
46
 
47
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
47
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
48
48
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
49
- set_variables
50
49
  end
51
50
  request_opts[:defined_params] = defined_params unless defined_params.empty?
52
51
 
@@ -22,40 +22,52 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
24
  # Update a document.
25
- # Updates a document by running a script or passing a partial document.
25
+ # Update a document by running a script or passing a partial document.
26
+ # If the Elasticsearch security features are enabled, you must have the +index+ or +write+ index privilege for the target index or index alias.
27
+ # The script can update, delete, or skip modifying the document.
28
+ # The API also supports passing a partial document, which is merged into the existing document.
29
+ # To fully replace an existing document, use the index API.
30
+ # This operation:
31
+ # * Gets the document (collocated with the shard) from the index.
32
+ # * Runs the specified script.
33
+ # * Indexes the result.
34
+ # The document must still be reindexed, but using this API removes some network roundtrips and reduces chances of version conflicts between the GET and the index operation.
35
+ # The +_source+ field must be enabled to use this API.
36
+ # In addition to +_source+, you can access the following variables through the +ctx+ map: +_index+, +_type+, +_id+, +_version+, +_routing+, and +_now+ (the current timestamp).
26
37
  #
27
- # @option arguments [String] :id Document ID (*Required*)
28
- # @option arguments [String] :index The name of the index (*Required*)
38
+ # @option arguments [String] :id A unique identifier for the document to be updated. (*Required*)
39
+ # @option arguments [String] :index The name of the target index.
40
+ # By default, the index is created automatically if it doesn't exist. (*Required*)
29
41
  # @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term.
30
42
  # @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number.
43
+ # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Server default: true.
31
44
  # @option arguments [String] :lang The script language. Server default: painless.
32
- # @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation
33
- # visible to search, if 'wait_for' then wait for a refresh to make this operation
34
- # visible to search, if 'false' do nothing with refreshes. Server default: false.
35
- # @option arguments [Boolean] :require_alias If true, the destination must be an index alias.
36
- # @option arguments [Integer] :retry_on_conflict Specify how many times should the operation be retried when a conflict occurs. Server default: 0.
37
- # @option arguments [String] :routing Custom value used to route operations to a specific shard.
38
- # @option arguments [Time] :timeout Period to wait for dynamic mapping updates and active shards.
39
- # This guarantees Elasticsearch waits for at least the timeout before failing.
45
+ # @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search.
46
+ # If 'wait_for', it waits for a refresh to make this operation visible to search.
47
+ # If 'false', it does nothing with refreshes. Server default: false.
48
+ # @option arguments [Boolean] :require_alias If +true+, the destination must be an index alias.
49
+ # @option arguments [Integer] :retry_on_conflict The number of times the operation should be retried when a conflict occurs. Server default: 0.
50
+ # @option arguments [String] :routing A custom value used to route operations to a specific shard.
51
+ # @option arguments [Time] :timeout The period to wait for the following operations: dynamic mapping updates and waiting for active shards.
52
+ # Elasticsearch waits for at least the timeout period before failing.
40
53
  # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m.
41
- # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operations.
42
- # Set to 'all' or any positive integer up to the total number of shards in the index
43
- # (number_of_replicas+1). Defaults to 1 meaning the primary shard. Server default: 1.
44
- # @option arguments [Boolean, String, Array<String>] :_source Set to false to disable source retrieval. You can also specify a comma-separated
45
- # list of the fields you want to retrieve. Server default: true.
46
- # @option arguments [String, Array<String>] :_source_excludes Specify the source fields you want to exclude.
47
- # @option arguments [String, Array<String>] :_source_includes Specify the source fields you want to retrieve.
54
+ # @option arguments [Integer, String] :wait_for_active_shards The number of copies of each shard that must be active before proceeding with the operation.
55
+ # Set to 'all' or any positive integer up to the total number of shards in the index (+number_of_replicas++1).
56
+ # The default value of +1+ means it waits for each primary shard to be active. Server default: 1.
57
+ # @option arguments [Boolean, String, Array<String>] :_source If +false+, source retrieval is turned off.
58
+ # You can also specify a comma-separated list of the fields you want to retrieve. Server default: true.
59
+ # @option arguments [String, Array<String>] :_source_excludes The source fields you want to exclude.
60
+ # @option arguments [String, Array<String>] :_source_includes The source fields you want to retrieve.
48
61
  # @option arguments [Hash] :headers Custom HTTP headers
49
62
  # @option arguments [Hash] :body request body
50
63
  #
51
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html
64
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update
52
65
  #
53
66
  def update(arguments = {})
54
- request_opts = { endpoint: arguments[:endpoint] || "update" }
67
+ request_opts = { endpoint: arguments[:endpoint] || 'update' }
55
68
 
56
- defined_params = [:index, :id].inject({}) do |set_variables, variable|
69
+ defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
57
70
  set_variables[variable] = arguments[variable] if arguments.key?(variable)
58
- set_variables
59
71
  end
60
72
  request_opts[:defined_params] = defined_params unless defined_params.empty?
61
73
 
@@ -77,11 +89,11 @@ module ElasticsearchServerless
77
89
  params = Utils.process_params(arguments)
78
90
 
79
91
  if Array(arguments[:ignore]).include?(404)
80
- Utils.rescue_from_not_found {
92
+ Utils.rescue_from_not_found do
81
93
  ElasticsearchServerless::API::Response.new(
82
94
  perform_request(method, path, params, body, headers, request_opts)
83
95
  )
84
- }
96
+ end
85
97
  else
86
98
  ElasticsearchServerless::API::Response.new(
87
99
  perform_request(method, path, params, body, headers, request_opts)