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.
- checksums.yaml +4 -4
- data/lib/elasticsearch-serverless/api/async_search/delete.rb +3 -4
- data/lib/elasticsearch-serverless/api/async_search/get.rb +4 -5
- data/lib/elasticsearch-serverless/api/async_search/status.rb +11 -8
- data/lib/elasticsearch-serverless/api/async_search/submit.rb +6 -10
- data/lib/elasticsearch-serverless/api/bulk.rb +109 -22
- data/lib/elasticsearch-serverless/api/cat/aliases.rb +17 -18
- data/lib/elasticsearch-serverless/api/cat/component_templates.rb +17 -16
- data/lib/elasticsearch-serverless/api/cat/count.rb +13 -18
- data/lib/elasticsearch-serverless/api/cat/help.rb +5 -19
- data/lib/elasticsearch-serverless/api/cat/indices.rb +10 -15
- data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +7 -17
- data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +6 -16
- data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +6 -16
- data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +7 -16
- data/lib/elasticsearch-serverless/api/cat/transforms.rb +6 -16
- data/lib/elasticsearch-serverless/api/clear_scroll.rb +9 -7
- data/lib/elasticsearch-serverless/api/close_point_in_time.rb +8 -4
- data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +3 -5
- data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +4 -5
- data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +5 -6
- data/lib/elasticsearch-serverless/api/cluster/info.rb +3 -4
- data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +6 -5
- data/lib/elasticsearch-serverless/api/connector/check_in.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/delete.rb +4 -4
- data/lib/elasticsearch-serverless/api/connector/get.rb +5 -5
- data/lib/elasticsearch-serverless/api/connector/list.rb +4 -3
- data/lib/elasticsearch-serverless/api/connector/post.rb +3 -3
- data/lib/elasticsearch-serverless/api/connector/put.rb +4 -5
- data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +7 -6
- data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +7 -6
- data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +7 -6
- data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +3 -3
- data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +3 -3
- data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_error.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +2 -3
- data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_name.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_native.rb +2 -3
- data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +3 -4
- data/lib/elasticsearch-serverless/api/connector/update_status.rb +3 -4
- data/lib/elasticsearch-serverless/api/count.rb +36 -25
- data/lib/elasticsearch-serverless/api/create.rb +77 -22
- data/lib/elasticsearch-serverless/api/delete.rb +44 -18
- data/lib/elasticsearch-serverless/api/delete_by_query.rb +91 -29
- data/lib/elasticsearch-serverless/api/delete_script.rb +10 -9
- data/lib/elasticsearch-serverless/api/enrich/delete_policy.rb +5 -5
- data/lib/elasticsearch-serverless/api/enrich/execute_policy.rb +6 -5
- data/lib/elasticsearch-serverless/api/enrich/get_policy.rb +6 -6
- data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +5 -5
- data/lib/elasticsearch-serverless/api/eql/delete.rb +5 -5
- data/lib/elasticsearch-serverless/api/eql/get.rb +5 -5
- data/lib/elasticsearch-serverless/api/eql/get_status.rb +5 -5
- data/lib/elasticsearch-serverless/api/eql/search.rb +9 -5
- data/lib/elasticsearch-serverless/api/exists.rb +38 -19
- data/lib/elasticsearch-serverless/api/exists_source.rb +23 -18
- data/lib/elasticsearch-serverless/api/explain.rb +25 -16
- data/lib/elasticsearch-serverless/api/field_caps.rb +16 -13
- data/lib/elasticsearch-serverless/api/get.rb +71 -21
- data/lib/elasticsearch-serverless/api/get_script.rb +7 -6
- data/lib/elasticsearch-serverless/api/get_source.rb +25 -15
- data/lib/elasticsearch-serverless/api/graph/explore.rb +9 -5
- data/lib/elasticsearch-serverless/api/index.rb +110 -21
- data/lib/elasticsearch-serverless/api/indices/add_block.rb +23 -12
- data/lib/elasticsearch-serverless/api/indices/analyze.rb +9 -6
- data/lib/elasticsearch-serverless/api/indices/create.rb +19 -6
- data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +3 -5
- data/lib/elasticsearch-serverless/api/indices/delete.rb +11 -8
- data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +4 -7
- data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +3 -4
- data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +3 -4
- data/lib/elasticsearch-serverless/api/indices/exists.rb +7 -8
- data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +8 -8
- data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +6 -6
- data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +4 -5
- data/lib/elasticsearch-serverless/api/indices/get.rb +5 -6
- data/lib/elasticsearch-serverless/api/indices/get_alias.rb +6 -6
- data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +4 -5
- data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +5 -6
- data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +5 -6
- data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +4 -6
- data/lib/elasticsearch-serverless/api/indices/get_settings.rb +6 -7
- data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +3 -4
- data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +3 -3
- data/lib/elasticsearch-serverless/api/indices/put_alias.rb +4 -7
- data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +4 -6
- data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +22 -4
- data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +21 -6
- data/lib/elasticsearch-serverless/api/indices/put_settings.rb +17 -7
- data/lib/elasticsearch-serverless/api/indices/refresh.rb +11 -5
- data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +5 -5
- data/lib/elasticsearch-serverless/api/indices/rollover.rb +28 -5
- data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +4 -5
- data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +5 -6
- data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +3 -3
- data/lib/elasticsearch-serverless/api/indices/validate_query.rb +4 -5
- data/lib/elasticsearch-serverless/api/inference/chat_completion_unified.rb +62 -0
- data/lib/elasticsearch-serverless/api/inference/completion.rb +62 -0
- data/lib/elasticsearch-serverless/api/inference/delete.rb +6 -11
- data/lib/elasticsearch-serverless/api/inference/get.rb +4 -9
- data/lib/elasticsearch-serverless/api/inference/inference.rb +0 -4
- data/lib/elasticsearch-serverless/api/inference/put.rb +12 -9
- data/lib/elasticsearch-serverless/api/inference/put_watsonx.rb +78 -0
- data/lib/elasticsearch-serverless/api/inference/rerank.rb +62 -0
- data/lib/elasticsearch-serverless/api/inference/sparse_embedding.rb +62 -0
- data/lib/elasticsearch-serverless/api/inference/text_embedding.rb +62 -0
- data/lib/elasticsearch-serverless/api/info.rb +4 -4
- data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +5 -5
- data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +6 -6
- data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +5 -4
- data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +3 -4
- data/lib/elasticsearch-serverless/api/ingest/simulate.rb +9 -8
- data/lib/elasticsearch-serverless/api/license/get.rb +4 -5
- data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +7 -6
- data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +7 -7
- data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +7 -6
- data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +4 -4
- data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +5 -5
- data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +3 -3
- data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +3 -9
- data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +5 -6
- data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +4 -5
- data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +6 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +6 -6
- data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +16 -5
- data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +7 -6
- data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +3 -4
- data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +3 -4
- data/lib/elasticsearch-serverless/api/mget.rb +12 -5
- data/lib/elasticsearch-serverless/api/msearch.rb +16 -17
- data/lib/elasticsearch-serverless/api/msearch_template.rb +23 -16
- data/lib/elasticsearch-serverless/api/mtermvectors.rb +15 -12
- data/lib/elasticsearch-serverless/api/open_point_in_time.rb +33 -11
- data/lib/elasticsearch-serverless/api/ping.rb +8 -10
- data/lib/elasticsearch-serverless/api/put_script.rb +12 -11
- data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +6 -5
- data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +6 -5
- data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +5 -5
- data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +5 -5
- data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +7 -6
- data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +11 -7
- data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +11 -6
- data/lib/elasticsearch-serverless/api/query_rules/test.rb +5 -5
- data/lib/elasticsearch-serverless/api/rank_eval.rb +8 -7
- data/lib/elasticsearch-serverless/api/reindex.rb +146 -9
- data/lib/elasticsearch-serverless/api/render_search_template.rb +7 -7
- data/lib/elasticsearch-serverless/api/response.rb +1 -1
- data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +7 -3
- data/lib/elasticsearch-serverless/api/scroll.rb +4 -4
- data/lib/elasticsearch-serverless/api/search.rb +79 -72
- data/lib/elasticsearch-serverless/api/search_application/delete.rb +4 -5
- data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_application/get.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +4 -5
- data/lib/elasticsearch-serverless/api/search_application/list.rb +5 -4
- data/lib/elasticsearch-serverless/api/search_application/put.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_application/search.rb +3 -4
- data/lib/elasticsearch-serverless/api/search_mvt.rb +132 -10
- data/lib/elasticsearch-serverless/api/search_template.rb +13 -13
- data/lib/elasticsearch-serverless/api/security/authenticate.rb +3 -3
- data/lib/elasticsearch-serverless/api/security/create_api_key.rb +7 -3
- data/lib/elasticsearch-serverless/api/security/delete_role.rb +6 -5
- data/lib/elasticsearch-serverless/api/security/get_api_key.rb +3 -3
- data/lib/elasticsearch-serverless/api/security/get_builtin_privileges.rb +3 -3
- data/lib/elasticsearch-serverless/api/security/get_role.rb +11 -8
- data/lib/elasticsearch-serverless/api/security/has_privileges.rb +6 -5
- data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +8 -6
- data/lib/elasticsearch-serverless/api/security/put_role.rb +3 -4
- data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +12 -6
- data/lib/elasticsearch-serverless/api/security/query_role.rb +61 -0
- data/lib/elasticsearch-serverless/api/security/update_api_key.rb +74 -0
- data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +4 -4
- data/lib/elasticsearch-serverless/api/sql/delete_async.rb +10 -6
- data/lib/elasticsearch-serverless/api/sql/get_async.rb +16 -13
- data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +6 -6
- data/lib/elasticsearch-serverless/api/sql/query.rb +8 -5
- data/lib/elasticsearch-serverless/api/sql/translate.rb +6 -4
- data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +17 -6
- data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +7 -7
- data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +7 -8
- data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +7 -7
- data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +7 -6
- data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -6
- data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -7
- data/lib/elasticsearch-serverless/api/tasks/get.rb +9 -7
- data/lib/elasticsearch-serverless/api/terms_enum.rb +7 -9
- data/lib/elasticsearch-serverless/api/termvectors.rb +40 -17
- data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +3 -5
- data/lib/elasticsearch-serverless/api/transform/get_transform.rb +5 -6
- data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +4 -5
- data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +4 -5
- data/lib/elasticsearch-serverless/api/transform/put_transform.rb +3 -4
- data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +4 -5
- data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +7 -8
- data/lib/elasticsearch-serverless/api/transform/start_transform.rb +3 -5
- data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +3 -4
- data/lib/elasticsearch-serverless/api/transform/update_transform.rb +3 -4
- data/lib/elasticsearch-serverless/api/update.rb +36 -24
- data/lib/elasticsearch-serverless/api/update_by_query.rb +102 -31
- data/lib/elasticsearch-serverless/api.rb +22 -25
- data/lib/elasticsearch-serverless/version.rb +1 -1
- data/lib/elasticsearch-serverless.rb +7 -0
- metadata +18 -7
@@ -21,33 +21,55 @@
|
|
21
21
|
module ElasticsearchServerless
|
22
22
|
module API
|
23
23
|
module Actions
|
24
|
-
#
|
24
|
+
# Open a point in time.
|
25
|
+
# A search request by default runs against the most recent visible data of the target indices,
|
25
26
|
# which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the
|
26
27
|
# state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple
|
27
28
|
# search requests using the same point in time. For example, if refreshes happen between
|
28
29
|
# +search_after+ requests, then the results of those requests might not be consistent as changes happening
|
29
30
|
# between searches are only visible to the more recent point in time.
|
31
|
+
# A point in time must be opened explicitly before being used in search requests.
|
32
|
+
# A subsequent search request with the +pit+ parameter must not specify +index+, +routing+, or +preference+ values as these parameters are copied from the point in time.
|
33
|
+
# Just like regular searches, you can use +from+ and +size+ to page through point in time search results, up to the first 10,000 hits.
|
34
|
+
# If you want to retrieve more hits, use PIT with +search_after+.
|
35
|
+
# IMPORTANT: The open point in time request and each subsequent search request can return different identifiers; always use the most recently received ID for the next search request.
|
36
|
+
# When a PIT that contains shard failures is used in a search request, the missing are always reported in the search response as a +NoShardAvailableActionException+ exception.
|
37
|
+
# To get rid of these exceptions, a new PIT needs to be created so that shards missing from the previous PIT can be handled, assuming they become available in the meantime.
|
38
|
+
# **Keeping point in time alive**
|
39
|
+
# The +keep_alive+ parameter, which is passed to a open point in time request and search request, extends the time to live of the corresponding point in time.
|
40
|
+
# The value does not need to be long enough to process all data — it just needs to be long enough for the next request.
|
41
|
+
# Normally, the background merge process optimizes the index by merging together smaller segments to create new, bigger segments.
|
42
|
+
# Once the smaller segments are no longer needed they are deleted.
|
43
|
+
# However, open point-in-times prevent the old segments from being deleted since they are still in use.
|
44
|
+
# TIP: Keeping older segments alive means that more disk space and file handles are needed.
|
45
|
+
# Ensure that you have configured your nodes to have ample free file handles.
|
46
|
+
# Additionally, if a segment contains deleted or updated documents then the point in time must keep track of whether each document in the segment was live at the time of the initial search request.
|
47
|
+
# Ensure that your nodes have sufficient heap space if you have many open point-in-times on an index that is subject to ongoing deletes or updates.
|
48
|
+
# Note that a point-in-time doesn't prevent its associated indices from being deleted.
|
49
|
+
# You can check how many point-in-times (that is, search contexts) are open with the nodes stats API.
|
30
50
|
#
|
31
51
|
# @option arguments [String, Array] :index A comma-separated list of index names to open point in time; use +_all+ or empty string to perform the operation on all indices (*Required*)
|
32
|
-
# @option arguments [Time] :keep_alive
|
52
|
+
# @option arguments [Time] :keep_alive Extend the length of time that the point in time persists. (*Required*)
|
33
53
|
# @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
|
34
|
-
# @option arguments [String] :preference
|
35
|
-
#
|
36
|
-
# @option arguments [String] :routing
|
37
|
-
# @option arguments [String, Array<String>] :expand_wildcards
|
54
|
+
# @option arguments [String] :preference The node or shard the operation should be performed on.
|
55
|
+
# By default, it is random.
|
56
|
+
# @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
|
57
|
+
# @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
|
38
58
|
# If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
|
39
|
-
#
|
59
|
+
# It supports comma-separated values, such as +open,hidden+. Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open.
|
60
|
+
# @option arguments [Boolean] :allow_partial_search_results Indicates whether the point in time tolerates unavailable shards or shard failures when initially creating the PIT.
|
61
|
+
# If +false+, creating a point in time request when a shard is missing or unavailable will throw an exception.
|
62
|
+
# If +true+, the point in time will contain all the shards that are available at the time of the request.
|
40
63
|
# @option arguments [Hash] :headers Custom HTTP headers
|
41
64
|
# @option arguments [Hash] :body request body
|
42
65
|
#
|
43
|
-
# @see https://www.elastic.co/
|
66
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time
|
44
67
|
#
|
45
68
|
def open_point_in_time(arguments = {})
|
46
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
69
|
+
request_opts = { endpoint: arguments[:endpoint] || 'open_point_in_time' }
|
47
70
|
|
48
|
-
defined_params = [:index].
|
71
|
+
defined_params = [:index].each_with_object({}) do |variable, set_variables|
|
49
72
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
50
|
-
set_variables
|
51
73
|
end
|
52
74
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
53
75
|
|
@@ -22,14 +22,14 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module Actions
|
24
24
|
# Ping the cluster.
|
25
|
-
#
|
25
|
+
# Get information about whether the cluster is running.
|
26
26
|
#
|
27
27
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
28
|
#
|
29
|
-
# @see https://www.elastic.co/
|
29
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cluster
|
30
30
|
#
|
31
31
|
def ping(arguments = {})
|
32
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
32
|
+
request_opts = { endpoint: arguments[:endpoint] || 'ping' }
|
33
33
|
|
34
34
|
arguments = arguments.clone
|
35
35
|
headers = arguments.delete(:headers) || {}
|
@@ -37,17 +37,15 @@ module ElasticsearchServerless
|
|
37
37
|
body = nil
|
38
38
|
|
39
39
|
method = ElasticsearchServerless::API::HTTP_HEAD
|
40
|
-
path =
|
40
|
+
path = ''
|
41
41
|
params = {}
|
42
42
|
|
43
43
|
begin
|
44
|
-
perform_request(method, path, params, body, headers, request_opts).status == 200
|
44
|
+
perform_request(method, path, params, body, headers, request_opts).status == 200
|
45
45
|
rescue Exception => e
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
raise e
|
50
|
-
end
|
46
|
+
raise e unless e.class.to_s =~ /NotFound|ConnectionFailed/ || e.message =~ /Not *Found|404|ConnectionFailed/i
|
47
|
+
|
48
|
+
false
|
51
49
|
end
|
52
50
|
end
|
53
51
|
end
|
@@ -24,25 +24,26 @@ module ElasticsearchServerless
|
|
24
24
|
# Create or update a script or search template.
|
25
25
|
# Creates or updates a stored script or search template.
|
26
26
|
#
|
27
|
-
# @option arguments [String] :id
|
28
|
-
#
|
29
|
-
# @option arguments [String] :context
|
27
|
+
# @option arguments [String] :id The identifier for the stored script or search template.
|
28
|
+
# It must be unique within the cluster. (*Required*)
|
29
|
+
# @option arguments [String] :context The context in which the script or search template should run.
|
30
30
|
# To prevent errors, the API immediately compiles the script or template in this context.
|
31
|
-
# @option arguments [Time] :master_timeout
|
32
|
-
# If no response is received before the timeout expires, the request fails and returns an error.
|
33
|
-
#
|
34
|
-
#
|
31
|
+
# @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
|
32
|
+
# If no response is received before the timeout expires, the request fails and returns an error.
|
33
|
+
# It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s.
|
34
|
+
# @option arguments [Time] :timeout The period to wait for a response.
|
35
|
+
# If no response is received before the timeout expires, the request fails and returns an error.
|
36
|
+
# It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s.
|
35
37
|
# @option arguments [Hash] :headers Custom HTTP headers
|
36
38
|
# @option arguments [Hash] :body request body
|
37
39
|
#
|
38
|
-
# @see https://www.elastic.co/
|
40
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script
|
39
41
|
#
|
40
42
|
def put_script(arguments = {})
|
41
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
43
|
+
request_opts = { endpoint: arguments[:endpoint] || 'put_script' }
|
42
44
|
|
43
|
-
defined_params = [:id, :context].
|
45
|
+
defined_params = [:id, :context].each_with_object({}) do |variable, set_variables|
|
44
46
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
45
|
-
set_variables
|
46
47
|
end
|
47
48
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
48
49
|
|
@@ -22,20 +22,21 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module QueryRules
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Delete a query rule.
|
26
|
+
# Delete a query rule within a query ruleset.
|
27
|
+
# This is a destructive action that is only recoverable by re-adding the same rule with the create or update query rule API.
|
26
28
|
#
|
27
29
|
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset containing the rule to delete (*Required*)
|
28
30
|
# @option arguments [String] :rule_id The unique identifier of the query rule within the specified ruleset to delete (*Required*)
|
29
31
|
# @option arguments [Hash] :headers Custom HTTP headers
|
30
32
|
#
|
31
|
-
# @see https://www.elastic.co/
|
33
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-rule
|
32
34
|
#
|
33
35
|
def delete_rule(arguments = {})
|
34
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
36
|
+
request_opts = { endpoint: arguments[:endpoint] || 'query_rules.delete_rule' }
|
35
37
|
|
36
|
-
defined_params = [:ruleset_id, :rule_id].
|
38
|
+
defined_params = [:ruleset_id, :rule_id].each_with_object({}) do |variable, set_variables|
|
37
39
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
38
|
-
set_variables
|
39
40
|
end
|
40
41
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
41
42
|
|
@@ -22,19 +22,20 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module QueryRules
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Delete a query ruleset.
|
26
|
+
# Remove a query ruleset and its associated data.
|
27
|
+
# This is a destructive action that is not recoverable.
|
26
28
|
#
|
27
29
|
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset to delete (*Required*)
|
28
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
31
|
#
|
30
|
-
# @see https://www.elastic.co/
|
32
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-ruleset
|
31
33
|
#
|
32
34
|
def delete_ruleset(arguments = {})
|
33
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
35
|
+
request_opts = { endpoint: arguments[:endpoint] || 'query_rules.delete_ruleset' }
|
34
36
|
|
35
|
-
defined_params = [:ruleset_id].
|
37
|
+
defined_params = [:ruleset_id].each_with_object({}) do |variable, set_variables|
|
36
38
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
37
|
-
set_variables
|
38
39
|
end
|
39
40
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
40
41
|
|
@@ -22,20 +22,20 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module QueryRules
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Get a query rule.
|
26
|
+
# Get details about a query rule within a query ruleset.
|
26
27
|
#
|
27
28
|
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset containing the rule to retrieve (*Required*)
|
28
29
|
# @option arguments [String] :rule_id The unique identifier of the query rule within the specified ruleset to retrieve (*Required*)
|
29
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
30
31
|
#
|
31
|
-
# @see https://www.elastic.co/
|
32
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-rule
|
32
33
|
#
|
33
34
|
def get_rule(arguments = {})
|
34
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
35
|
+
request_opts = { endpoint: arguments[:endpoint] || 'query_rules.get_rule' }
|
35
36
|
|
36
|
-
defined_params = [:ruleset_id, :rule_id].
|
37
|
+
defined_params = [:ruleset_id, :rule_id].each_with_object({}) do |variable, set_variables|
|
37
38
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
38
|
-
set_variables
|
39
39
|
end
|
40
40
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
41
41
|
|
@@ -22,19 +22,19 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module QueryRules
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Get a query ruleset.
|
26
|
+
# Get details about a query ruleset.
|
26
27
|
#
|
27
28
|
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset (*Required*)
|
28
29
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
30
|
#
|
30
|
-
# @see https://www.elastic.co/
|
31
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-ruleset
|
31
32
|
#
|
32
33
|
def get_ruleset(arguments = {})
|
33
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
34
|
+
request_opts = { endpoint: arguments[:endpoint] || 'query_rules.get_ruleset' }
|
34
35
|
|
35
|
-
defined_params = [:ruleset_id].
|
36
|
+
defined_params = [:ruleset_id].each_with_object({}) do |variable, set_variables|
|
36
37
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
37
|
-
set_variables
|
38
38
|
end
|
39
39
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
40
40
|
|
@@ -22,16 +22,17 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module QueryRules
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Get all query rulesets.
|
26
|
+
# Get summarized information about the query rulesets.
|
26
27
|
#
|
27
|
-
# @option arguments [Integer] :from
|
28
|
-
# @option arguments [Integer] :size
|
28
|
+
# @option arguments [Integer] :from The offset from the first result to fetch. Server default: 0.
|
29
|
+
# @option arguments [Integer] :size The maximum number of results to retrieve.
|
29
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
30
31
|
#
|
31
|
-
# @see https://www.elastic.co/
|
32
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-list-rulesets
|
32
33
|
#
|
33
34
|
def list_rulesets(arguments = {})
|
34
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
35
|
+
request_opts = { endpoint: arguments[:endpoint] || 'query_rules.list_rulesets' }
|
35
36
|
|
36
37
|
arguments = arguments.clone
|
37
38
|
headers = arguments.delete(:headers) || {}
|
@@ -39,7 +40,7 @@ module ElasticsearchServerless
|
|
39
40
|
body = nil
|
40
41
|
|
41
42
|
method = ElasticsearchServerless::API::HTTP_GET
|
42
|
-
path =
|
43
|
+
path = '_query_rules'
|
43
44
|
params = Utils.process_params(arguments)
|
44
45
|
|
45
46
|
ElasticsearchServerless::API::Response.new(
|
@@ -22,21 +22,25 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module QueryRules
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Create or update a query rule.
|
26
|
+
# Create or update a query rule within a query ruleset.
|
27
|
+
# IMPORTANT: Due to limitations within pinned queries, you can only pin documents using ids or docs, but cannot use both in single rule.
|
28
|
+
# It is advised to use one or the other in query rulesets, to avoid errors.
|
29
|
+
# Additionally, pinned queries have a maximum limit of 100 pinned hits.
|
30
|
+
# If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.
|
26
31
|
#
|
27
|
-
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset containing the rule to be created or updated (*Required*)
|
28
|
-
# @option arguments [String] :rule_id The unique identifier of the query rule within the specified ruleset to be created or updated (*Required*)
|
32
|
+
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset containing the rule to be created or updated. (*Required*)
|
33
|
+
# @option arguments [String] :rule_id The unique identifier of the query rule within the specified ruleset to be created or updated. (*Required*)
|
29
34
|
# @option arguments [Hash] :headers Custom HTTP headers
|
30
35
|
# @option arguments [Hash] :body request body
|
31
36
|
#
|
32
|
-
# @see https://www.elastic.co/
|
37
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-rule
|
33
38
|
#
|
34
39
|
def put_rule(arguments = {})
|
35
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
40
|
+
request_opts = { endpoint: arguments[:endpoint] || 'query_rules.put_rule' }
|
36
41
|
|
37
|
-
defined_params = [:ruleset_id, :rule_id].
|
42
|
+
defined_params = [:ruleset_id, :rule_id].each_with_object({}) do |variable, set_variables|
|
38
43
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
39
|
-
set_variables
|
40
44
|
end
|
41
45
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
42
46
|
|
@@ -22,20 +22,25 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module QueryRules
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Create or update a query ruleset.
|
26
|
+
# There is a limit of 100 rules per ruleset.
|
27
|
+
# This limit can be increased by using the +xpack.applications.rules.max_rules_per_ruleset+ cluster setting.
|
28
|
+
# IMPORTANT: Due to limitations within pinned queries, you can only select documents using +ids+ or +docs+, but cannot use both in single rule.
|
29
|
+
# It is advised to use one or the other in query rulesets, to avoid errors.
|
30
|
+
# Additionally, pinned queries have a maximum limit of 100 pinned hits.
|
31
|
+
# If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset.
|
26
32
|
#
|
27
|
-
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset to be created or updated (*Required*)
|
33
|
+
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset to be created or updated. (*Required*)
|
28
34
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
35
|
# @option arguments [Hash] :body request body
|
30
36
|
#
|
31
|
-
# @see https://www.elastic.co/
|
37
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-ruleset
|
32
38
|
#
|
33
39
|
def put_ruleset(arguments = {})
|
34
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
40
|
+
request_opts = { endpoint: arguments[:endpoint] || 'query_rules.put_ruleset' }
|
35
41
|
|
36
|
-
defined_params = [:ruleset_id].
|
42
|
+
defined_params = [:ruleset_id].each_with_object({}) do |variable, set_variables|
|
37
43
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
38
|
-
set_variables
|
39
44
|
end
|
40
45
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
41
46
|
|
@@ -22,20 +22,20 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module QueryRules
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Test a query ruleset.
|
26
|
+
# Evaluate match criteria against a query ruleset to identify the rules that would match that criteria.
|
26
27
|
#
|
27
28
|
# @option arguments [String] :ruleset_id The unique identifier of the query ruleset to be created or updated (*Required*)
|
28
29
|
# @option arguments [Hash] :headers Custom HTTP headers
|
29
30
|
# @option arguments [Hash] :body request body
|
30
31
|
#
|
31
|
-
# @see https://www.elastic.co/
|
32
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-test
|
32
33
|
#
|
33
34
|
def test(arguments = {})
|
34
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
35
|
+
request_opts = { endpoint: arguments[:endpoint] || 'query_rules.test' }
|
35
36
|
|
36
|
-
defined_params = [:ruleset_id].
|
37
|
+
defined_params = [:ruleset_id].each_with_object({}) do |variable, set_variables|
|
37
38
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
38
|
-
set_variables
|
39
39
|
end
|
40
40
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
41
41
|
|
@@ -21,9 +21,11 @@
|
|
21
21
|
module ElasticsearchServerless
|
22
22
|
module API
|
23
23
|
module Actions
|
24
|
-
#
|
24
|
+
# Evaluate ranked search results.
|
25
|
+
# Evaluate the quality of ranked search results over a set of typical search queries.
|
25
26
|
#
|
26
|
-
# @option arguments [String, Array] :index
|
27
|
+
# @option arguments [String, Array] :index A comma-separated list of data streams, indices, and index aliases used to limit the request.
|
28
|
+
# Wildcard (+*+) expressions are supported.
|
27
29
|
# To target all data streams and indices in a cluster, omit this parameter or use +_all+ or +*+.
|
28
30
|
# @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.
|
29
31
|
# @option arguments [String, Array<String>] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
@@ -32,14 +34,13 @@ module ElasticsearchServerless
|
|
32
34
|
# @option arguments [Hash] :headers Custom HTTP headers
|
33
35
|
# @option arguments [Hash] :body request body
|
34
36
|
#
|
35
|
-
# @see https://www.elastic.co/
|
37
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rank-eval
|
36
38
|
#
|
37
39
|
def rank_eval(arguments = {})
|
38
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
40
|
+
request_opts = { endpoint: arguments[:endpoint] || 'rank_eval' }
|
39
41
|
|
40
|
-
defined_params = [:index].
|
42
|
+
defined_params = [:index].each_with_object({}) do |variable, set_variables|
|
41
43
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
42
|
-
set_variables
|
43
44
|
end
|
44
45
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
45
46
|
|
@@ -56,7 +57,7 @@ module ElasticsearchServerless
|
|
56
57
|
path = if _index
|
57
58
|
"#{Utils.listify(_index)}/_rank_eval"
|
58
59
|
else
|
59
|
-
|
60
|
+
'_rank_eval'
|
60
61
|
end
|
61
62
|
params = Utils.process_params(arguments)
|
62
63
|
|
@@ -22,26 +22,163 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module Actions
|
24
24
|
# Reindex documents.
|
25
|
-
#
|
25
|
+
# Copy documents from a source to a destination.
|
26
|
+
# You can copy all documents to the destination index or reindex a subset of the documents.
|
27
|
+
# The source can be any existing index, alias, or data stream.
|
28
|
+
# The destination must differ from the source.
|
29
|
+
# For example, you cannot reindex a data stream into itself.
|
30
|
+
# IMPORTANT: Reindex requires +_source+ to be enabled for all documents in the source.
|
31
|
+
# The destination should be configured as wanted before calling the reindex API.
|
32
|
+
# Reindex does not copy the settings from the source or its associated template.
|
33
|
+
# Mappings, shard counts, and replicas, for example, must be configured ahead of time.
|
34
|
+
# If the Elasticsearch security features are enabled, you must have the following security privileges:
|
35
|
+
# * The +read+ index privilege for the source data stream, index, or alias.
|
36
|
+
# * The +write+ index privilege for the destination data stream, index, or index alias.
|
37
|
+
# * To automatically create a data stream or index with a reindex API request, you must have the +auto_configure+, +create_index+, or +manage+ index privilege for the destination data stream, index, or alias.
|
38
|
+
# * If reindexing from a remote cluster, the +source.remote.user+ must have the +monitor+ cluster privilege and the +read+ index privilege for the source data stream, index, or alias.
|
39
|
+
# If reindexing from a remote cluster, you must explicitly allow the remote host in the +reindex.remote.whitelist+ setting.
|
40
|
+
# Automatic data stream creation requires a matching index template with data stream enabled.
|
41
|
+
# The +dest+ element can be configured like the index API to control optimistic concurrency control.
|
42
|
+
# Omitting +version_type+ or setting it to +internal+ causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID.
|
43
|
+
# Setting +version_type+ to +external+ causes Elasticsearch to preserve the +version+ from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source.
|
44
|
+
# Setting +op_type+ to +create+ causes the reindex API to create only missing documents in the destination.
|
45
|
+
# All existing documents will cause a version conflict.
|
46
|
+
# IMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an +op_type+ of +create+.
|
47
|
+
# A reindex can only add new documents to a destination data stream.
|
48
|
+
# It cannot update existing documents in a destination data stream.
|
49
|
+
# By default, version conflicts abort the reindex process.
|
50
|
+
# To continue reindexing if there are conflicts, set the +conflicts+ request body property to +proceed+.
|
51
|
+
# In this case, the response includes a count of the version conflicts that were encountered.
|
52
|
+
# Note that the handling of other error types is unaffected by the +conflicts+ property.
|
53
|
+
# Additionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than +max_docs+ until it has successfully indexed +max_docs+ documents into the target or it has gone through every document in the source query.
|
54
|
+
# NOTE: The reindex API makes no effort to handle ID collisions.
|
55
|
+
# The last document written will "win" but the order isn't usually predictable so it is not a good idea to rely on this behavior.
|
56
|
+
# Instead, make sure that IDs are unique by using a script.
|
57
|
+
# **Running reindex asynchronously**
|
58
|
+
# If the request contains +wait_for_completion=false+, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task.
|
59
|
+
# Elasticsearch creates a record of this task as a document at +_tasks/<task_id>+.
|
60
|
+
# **Reindex from multiple sources**
|
61
|
+
# If you have many sources to reindex it is generally better to reindex them one at a time rather than using a glob pattern to pick up multiple sources.
|
62
|
+
# That way you can resume the process if there are any errors by removing the partially completed source and starting over.
|
63
|
+
# It also makes parallelizing the process fairly simple: split the list of sources to reindex and run each list in parallel.
|
64
|
+
# For example, you can use a bash script like this:
|
65
|
+
# +
|
66
|
+
# for index in i1 i2 i3 i4 i5; do
|
67
|
+
# curl -HContent-Type:application/json -XPOST localhost:9200/_reindex?pretty -d'{
|
68
|
+
# "source": {
|
69
|
+
# "index": "'$index'"
|
70
|
+
# },
|
71
|
+
# "dest": {
|
72
|
+
# "index": "'$index'-reindexed"
|
73
|
+
# }
|
74
|
+
# }'
|
75
|
+
# done
|
76
|
+
# +
|
77
|
+
# **Throttling**
|
78
|
+
# Set +requests_per_second+ to any positive decimal number (+1.4+, +6+, +1000+, for example) to throttle the rate at which reindex issues batches of index operations.
|
79
|
+
# Requests are throttled by padding each batch with a wait time.
|
80
|
+
# To turn off throttling, set +requests_per_second+ to +-1+.
|
81
|
+
# The throttling is done by waiting between batches so that the scroll that reindex uses internally can be given a timeout that takes into account the padding.
|
82
|
+
# The padding time is the difference between the batch size divided by the +requests_per_second+ and the time spent writing.
|
83
|
+
# By default the batch size is +1000+, so if +requests_per_second+ is set to +500+:
|
84
|
+
# +
|
85
|
+
# target_time = 1000 / 500 per second = 2 seconds
|
86
|
+
# wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
|
87
|
+
# +
|
88
|
+
# Since the batch is issued as a single bulk request, large batch sizes cause Elasticsearch to create many requests and then wait for a while before starting the next set.
|
89
|
+
# This is "bursty" instead of "smooth".
|
90
|
+
# **Slicing**
|
91
|
+
# Reindex supports sliced scroll to parallelize the reindexing process.
|
92
|
+
# This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.
|
93
|
+
# NOTE: Reindexing from remote clusters does not support manual or automatic slicing.
|
94
|
+
# You can slice a reindex request manually by providing a slice ID and total number of slices to each request.
|
95
|
+
# You can also let reindex automatically parallelize by using sliced scroll to slice on +_id+.
|
96
|
+
# The +slices+ parameter specifies the number of slices to use.
|
97
|
+
# Adding +slices+ to the reindex request just automates the manual process, creating sub-requests which means it has some quirks:
|
98
|
+
# * You can see these requests in the tasks API. These sub-requests are "child" tasks of the task for the request with slices.
|
99
|
+
# * Fetching the status of the task for the request with +slices+ only contains the status of completed slices.
|
100
|
+
# * These sub-requests are individually addressable for things like cancellation and rethrottling.
|
101
|
+
# * Rethrottling the request with +slices+ will rethrottle the unfinished sub-request proportionally.
|
102
|
+
# * Canceling the request with +slices+ will cancel each sub-request.
|
103
|
+
# * Due to the nature of +slices+, each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution.
|
104
|
+
# * Parameters like +requests_per_second+ and +max_docs+ on a request with +slices+ are distributed proportionally to each sub-request. Combine that with the previous point about distribution being uneven and you should conclude that using +max_docs+ with +slices+ might not result in exactly +max_docs+ documents being reindexed.
|
105
|
+
# * Each sub-request gets a slightly different snapshot of the source, though these are all taken at approximately the same time.
|
106
|
+
# If slicing automatically, setting +slices+ to +auto+ will choose a reasonable number for most indices.
|
107
|
+
# If slicing manually or otherwise tuning automatic slicing, use the following guidelines.
|
108
|
+
# Query performance is most efficient when the number of slices is equal to the number of shards in the index.
|
109
|
+
# If that number is large (for example, +500+), choose a lower number as too many slices will hurt performance.
|
110
|
+
# Setting slices higher than the number of shards generally does not improve efficiency and adds overhead.
|
111
|
+
# Indexing performance scales linearly across available resources with the number of slices.
|
112
|
+
# Whether query or indexing performance dominates the runtime depends on the documents being reindexed and cluster resources.
|
113
|
+
# **Modify documents during reindexing**
|
114
|
+
# Like +_update_by_query+, reindex operations support a script that modifies the document.
|
115
|
+
# Unlike +_update_by_query+, the script is allowed to modify the document's metadata.
|
116
|
+
# Just as in +_update_by_query+, you can set +ctx.op+ to change the operation that is run on the destination.
|
117
|
+
# For example, set +ctx.op+ to +noop+ if your script decides that the document doesn’t have to be indexed in the destination. This "no operation" will be reported in the +noop+ counter in the response body.
|
118
|
+
# Set +ctx.op+ to +delete+ if your script decides that the document must be deleted from the destination.
|
119
|
+
# The deletion will be reported in the +deleted+ counter in the response body.
|
120
|
+
# Setting +ctx.op+ to anything else will return an error, as will setting any other field in +ctx+.
|
121
|
+
# Think of the possibilities! Just be careful; you are able to change:
|
122
|
+
# * +_id+
|
123
|
+
# * +_index+
|
124
|
+
# * +_version+
|
125
|
+
# * +_routing+
|
126
|
+
# Setting +_version+ to +null+ or clearing it from the +ctx+ map is just like not sending the version in an indexing request.
|
127
|
+
# It will cause the document to be overwritten in the destination regardless of the version on the target or the version type you use in the reindex API.
|
128
|
+
# **Reindex from remote**
|
129
|
+
# Reindex supports reindexing from a remote Elasticsearch cluster.
|
130
|
+
# The +host+ parameter must contain a scheme, host, port, and optional path.
|
131
|
+
# The +username+ and +password+ parameters are optional and when they are present the reindex operation will connect to the remote Elasticsearch node using basic authentication.
|
132
|
+
# Be sure to use HTTPS when using basic authentication or the password will be sent in plain text.
|
133
|
+
# There are a range of settings available to configure the behavior of the HTTPS connection.
|
134
|
+
# When using Elastic Cloud, it is also possible to authenticate against the remote cluster through the use of a valid API key.
|
135
|
+
# Remote hosts must be explicitly allowed with the +reindex.remote.whitelist+ setting.
|
136
|
+
# It can be set to a comma delimited list of allowed remote host and port combinations.
|
137
|
+
# Scheme is ignored; only the host and port are used.
|
138
|
+
# For example:
|
139
|
+
# +
|
140
|
+
# reindex.remote.whitelist: [otherhost:9200, another:9200, 127.0.10.*:9200, localhost:*"]
|
141
|
+
# +
|
142
|
+
# The list of allowed hosts must be configured on any nodes that will coordinate the reindex.
|
143
|
+
# This feature should work with remote clusters of any version of Elasticsearch.
|
144
|
+
# This should enable you to upgrade from any version of Elasticsearch to the current version by reindexing from a cluster of the old version.
|
145
|
+
# WARNING: Elasticsearch does not support forward compatibility across major versions.
|
146
|
+
# For example, you cannot reindex from a 7.x cluster into a 6.x cluster.
|
147
|
+
# To enable queries sent to older versions of Elasticsearch, the +query+ parameter is sent directly to the remote host without validation or modification.
|
148
|
+
# NOTE: Reindexing from remote clusters does not support manual or automatic slicing.
|
149
|
+
# Reindexing from a remote server uses an on-heap buffer that defaults to a maximum size of 100mb.
|
150
|
+
# If the remote index includes very large documents you'll need to use a smaller batch size.
|
151
|
+
# It is also possible to set the socket read timeout on the remote connection with the +socket_timeout+ field and the connection timeout with the +connect_timeout+ field.
|
152
|
+
# Both default to 30 seconds.
|
153
|
+
# **Configuring SSL parameters**
|
154
|
+
# Reindex from remote supports configurable SSL settings.
|
155
|
+
# These must be specified in the +elasticsearch.yml+ file, with the exception of the secure settings, which you add in the Elasticsearch keystore.
|
156
|
+
# It is not possible to configure SSL in the body of the reindex request.
|
26
157
|
#
|
27
158
|
# @option arguments [Boolean] :refresh If +true+, the request refreshes affected shards to make this operation visible to search.
|
28
159
|
# @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second.
|
29
|
-
#
|
30
|
-
# @option arguments [Time] :scroll
|
160
|
+
# By default, there is no throttle. Server default: -1.
|
161
|
+
# @option arguments [Time] :scroll The period of time that a consistent view of the index should be maintained for scrolled search.
|
31
162
|
# @option arguments [Integer, String] :slices The number of slices this task should be divided into.
|
32
|
-
#
|
33
|
-
#
|
163
|
+
# It defaults to one slice, which means the task isn't sliced into subtasks.Reindex supports sliced scroll to parallelize the reindexing process.
|
164
|
+
# This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.NOTE: Reindexing from remote clusters does not support manual or automatic slicing.If set to +auto+, Elasticsearch chooses the number of slices to use.
|
165
|
+
# This setting will use one slice per shard, up to a certain limit.
|
166
|
+
# If there are multiple sources, it will choose the number of slices based on the index or backing index with the smallest number of shards. Server default: 1.
|
167
|
+
# @option arguments [Time] :timeout The period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards.
|
168
|
+
# By default, Elasticsearch waits for at least one minute before failing.
|
169
|
+
# The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m.
|
34
170
|
# @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
|
35
|
-
# Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
|
171
|
+
# Set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
|
172
|
+
# The default value is one, which means it waits for each primary shard to be active. Server default: 1.
|
36
173
|
# @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete. Server default: true.
|
37
174
|
# @option arguments [Boolean] :require_alias If +true+, the destination must be an index alias.
|
38
175
|
# @option arguments [Hash] :headers Custom HTTP headers
|
39
176
|
# @option arguments [Hash] :body request body
|
40
177
|
#
|
41
|
-
# @see https://www.elastic.co/
|
178
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex
|
42
179
|
#
|
43
180
|
def reindex(arguments = {})
|
44
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
181
|
+
request_opts = { endpoint: arguments[:endpoint] || 'reindex' }
|
45
182
|
|
46
183
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
47
184
|
|
@@ -51,7 +188,7 @@ module ElasticsearchServerless
|
|
51
188
|
body = arguments.delete(:body)
|
52
189
|
|
53
190
|
method = ElasticsearchServerless::API::HTTP_POST
|
54
|
-
path =
|
191
|
+
path = '_reindex'
|
55
192
|
params = Utils.process_params(arguments)
|
56
193
|
|
57
194
|
ElasticsearchServerless::API::Response.new(
|