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,37 +21,92 @@
|
|
21
21
|
module ElasticsearchServerless
|
22
22
|
module API
|
23
23
|
module Actions
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
24
|
+
# Create a new document in the index.
|
25
|
+
# You can index a new JSON document with the +/<target>/_doc/+ or +/<target>/_create/<_id>+ APIs
|
26
|
+
# Using +_create+ guarantees that the document is indexed only if it does not already exist.
|
27
|
+
# It returns a 409 response when a document with a same ID already exists in the index.
|
28
|
+
# To update an existing document, you must use the +/<target>/_doc/+ API.
|
29
|
+
# If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias:
|
30
|
+
# * To add a document using the +PUT /<target>/_create/<_id>+ or +POST /<target>/_create/<_id>+ request formats, you must have the +create_doc+, +create+, +index+, or +write+ index privilege.
|
31
|
+
# * To automatically create a data stream or index with this API request, you must have the +auto_configure+, +create_index+, or +manage+ index privilege.
|
32
|
+
# Automatic data stream creation requires a matching index template with data stream enabled.
|
33
|
+
# **Automatically create data streams and indices**
|
34
|
+
# If the request's target doesn't exist and matches an index template with a +data_stream+ definition, the index operation automatically creates the data stream.
|
35
|
+
# If the target doesn't exist and doesn't match a data stream template, the operation automatically creates the index and applies any matching index templates.
|
36
|
+
# NOTE: Elasticsearch includes several built-in index templates. To avoid naming collisions with these templates, refer to index pattern documentation.
|
37
|
+
# If no mapping exists, the index operation creates a dynamic mapping.
|
38
|
+
# By default, new fields and objects are automatically added to the mapping if needed.
|
39
|
+
# Automatic index creation is controlled by the +action.auto_create_index+ setting.
|
40
|
+
# If it is +true+, any index can be created automatically.
|
41
|
+
# You can modify this setting to explicitly allow or block automatic creation of indices that match specified patterns or set it to +false+ to turn off automatic index creation entirely.
|
42
|
+
# Specify a comma-separated list of patterns you want to allow or prefix each pattern with +++ or +-+ to indicate whether it should be allowed or blocked.
|
43
|
+
# When a list is specified, the default behaviour is to disallow.
|
44
|
+
# NOTE: The +action.auto_create_index+ setting affects the automatic creation of indices only.
|
45
|
+
# It does not affect the creation of data streams.
|
46
|
+
# **Routing**
|
47
|
+
# By default, shard placement — or routing — is controlled by using a hash of the document's ID value.
|
48
|
+
# For more explicit control, the value fed into the hash function used by the router can be directly specified on a per-operation basis using the +routing+ parameter.
|
49
|
+
# When setting up explicit mapping, you can also use the +_routing+ field to direct the index operation to extract the routing value from the document itself.
|
50
|
+
# This does come at the (very minimal) cost of an additional document parsing pass.
|
51
|
+
# If the +_routing+ mapping is defined and set to be required, the index operation will fail if no routing value is provided or extracted.
|
52
|
+
# NOTE: Data streams do not support custom routing unless they were created with the +allow_custom_routing+ setting enabled in the template.
|
53
|
+
# **Distributed**
|
54
|
+
# The index operation is directed to the primary shard based on its route and performed on the actual node containing this shard.
|
55
|
+
# After the primary shard completes the operation, if needed, the update is distributed to applicable replicas.
|
56
|
+
# **Active shards**
|
57
|
+
# To improve the resiliency of writes to the system, indexing operations can be configured to wait for a certain number of active shard copies before proceeding with the operation.
|
58
|
+
# If the requisite number of active shard copies are not available, then the write operation must wait and retry, until either the requisite shard copies have started or a timeout occurs.
|
59
|
+
# By default, write operations only wait for the primary shards to be active before proceeding (that is to say +wait_for_active_shards+ is +1+).
|
60
|
+
# This default can be overridden in the index settings dynamically by setting +index.write.wait_for_active_shards+.
|
61
|
+
# To alter this behavior per operation, use the +wait_for_active_shards request+ parameter.
|
62
|
+
# Valid values are all or any positive integer up to the total number of configured copies per shard in the index (which is +number_of_replicas++1).
|
63
|
+
# Specifying a negative value or a number greater than the number of shard copies will throw an error.
|
64
|
+
# For example, suppose you have a cluster of three nodes, A, B, and C and you create an index index with the number of replicas set to 3 (resulting in 4 shard copies, one more copy than there are nodes).
|
65
|
+
# If you attempt an indexing operation, by default the operation will only ensure the primary copy of each shard is available before proceeding.
|
66
|
+
# This means that even if B and C went down and A hosted the primary shard copies, the indexing operation would still proceed with only one copy of the data.
|
67
|
+
# If +wait_for_active_shards+ is set on the request to +3+ (and all three nodes are up), the indexing operation will require 3 active shard copies before proceeding.
|
68
|
+
# This requirement should be met because there are 3 active nodes in the cluster, each one holding a copy of the shard.
|
69
|
+
# However, if you set +wait_for_active_shards+ to +all+ (or to +4+, which is the same in this situation), the indexing operation will not proceed as you do not have all 4 copies of each shard active in the index.
|
70
|
+
# The operation will timeout unless a new node is brought up in the cluster to host the fourth copy of the shard.
|
71
|
+
# It is important to note that this setting greatly reduces the chances of the write operation not writing to the requisite number of shard copies, but it does not completely eliminate the possibility, because this check occurs before the write operation starts.
|
72
|
+
# After the write operation is underway, it is still possible for replication to fail on any number of shard copies but still succeed on the primary.
|
73
|
+
# The +_shards+ section of the API response reveals the number of shard copies on which replication succeeded and failed.
|
27
74
|
#
|
28
|
-
# @option arguments [String] :id
|
29
|
-
#
|
30
|
-
#
|
31
|
-
# If the target doesn
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
# @option arguments [String] :
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
# @option arguments [
|
75
|
+
# @option arguments [String] :id A unique identifier for the document.
|
76
|
+
# To automatically generate a document ID, use the +POST /<target>/_doc/+ request format. (*Required*)
|
77
|
+
# @option arguments [String] :index The name of the data stream or index to target.
|
78
|
+
# If the target doesn't exist and matches the name or wildcard (+*+) pattern of an index template with a +data_stream+ definition, this request creates the data stream.
|
79
|
+
# If the target doesn't exist and doesn’t match a data stream template, this request creates the index. (*Required*)
|
80
|
+
# @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.
|
81
|
+
# @option arguments [String] :pipeline The ID of the pipeline to use to preprocess incoming documents.
|
82
|
+
# If the index has a default ingest pipeline specified, setting the value to +_none+ turns off the default ingest pipeline for this request.
|
83
|
+
# If a final pipeline is configured, it will always run regardless of the value of this parameter.
|
84
|
+
# @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search.
|
85
|
+
# If +wait_for+, it waits for a refresh to make this operation visible to search.
|
86
|
+
# If +false+, it does nothing with refreshes. Server default: false.
|
87
|
+
# @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
|
88
|
+
# @option arguments [Time] :timeout The period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
|
89
|
+
# Elasticsearch waits for at least the specified timeout period before failing.
|
90
|
+
# The actual wait time could be longer, particularly when multiple waits occur.This parameter is useful for situations where the primary shard assigned to perform the operation might not be available when the operation runs.
|
91
|
+
# Some reasons for this might be that the primary shard is currently recovering from a gateway or undergoing relocation.
|
92
|
+
# By default, the operation will wait on the primary shard to become available for at least 1 minute before failing and responding with an error.
|
93
|
+
# The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m.
|
94
|
+
# @option arguments [Integer] :version The explicit version number for concurrency control.
|
95
|
+
# It must be a non-negative long number.
|
96
|
+
# @option arguments [String] :version_type The version type.
|
42
97
|
# @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
|
43
|
-
#
|
98
|
+
# You can set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
|
99
|
+
# The default value of +1+ means it waits for each primary shard to be active. Server default: 1.
|
44
100
|
# @option arguments [Hash] :headers Custom HTTP headers
|
45
101
|
# @option arguments [Hash] :body document
|
46
102
|
#
|
47
|
-
# @see https://www.elastic.co/
|
103
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create
|
48
104
|
#
|
49
105
|
def create(arguments = {})
|
50
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
106
|
+
request_opts = { endpoint: arguments[:endpoint] || 'create' }
|
51
107
|
|
52
|
-
defined_params = [:index, :id].
|
108
|
+
defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
|
53
109
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
54
|
-
set_variables
|
55
110
|
end
|
56
111
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
57
112
|
|
@@ -22,31 +22,57 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module Actions
|
24
24
|
# Delete a document.
|
25
|
-
#
|
25
|
+
# Remove a JSON document from the specified index.
|
26
|
+
# NOTE: You cannot send deletion requests directly to a data stream.
|
27
|
+
# To delete a document in a data stream, you must target the backing index containing the document.
|
28
|
+
# **Optimistic concurrency control**
|
29
|
+
# Delete operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the +if_seq_no+ and +if_primary_term+ parameters.
|
30
|
+
# If a mismatch is detected, the operation will result in a +VersionConflictException+ and a status code of +409+.
|
31
|
+
# **Versioning**
|
32
|
+
# Each document indexed is versioned.
|
33
|
+
# When deleting a document, the version can be specified to make sure the relevant document you are trying to delete is actually being deleted and it has not changed in the meantime.
|
34
|
+
# Every write operation run on a document, deletes included, causes its version to be incremented.
|
35
|
+
# The version number of a deleted document remains available for a short time after deletion to allow for control of concurrent operations.
|
36
|
+
# The length of time for which a deleted document's version remains available is determined by the +index.gc_deletes+ index setting.
|
37
|
+
# **Routing**
|
38
|
+
# If routing is used during indexing, the routing value also needs to be specified to delete a document.
|
39
|
+
# If the +_routing+ mapping is set to +required+ and no routing value is specified, the delete API throws a +RoutingMissingException+ and rejects the request.
|
40
|
+
# For example:
|
41
|
+
# +
|
42
|
+
# DELETE /my-index-000001/_doc/1?routing=shard-1
|
43
|
+
# +
|
44
|
+
# This request deletes the document with ID 1, but it is routed based on the user.
|
45
|
+
# The document is not deleted if the correct routing is not specified.
|
46
|
+
# **Distributed**
|
47
|
+
# The delete operation gets hashed into a specific shard ID.
|
48
|
+
# It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group.
|
26
49
|
#
|
27
|
-
# @option arguments [String] :id
|
28
|
-
# @option arguments [String] :index
|
50
|
+
# @option arguments [String] :id A unique identifier for the document. (*Required*)
|
51
|
+
# @option arguments [String] :index The name of the target index. (*Required*)
|
29
52
|
# @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term.
|
30
53
|
# @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number.
|
31
|
-
# @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search
|
32
|
-
#
|
33
|
-
#
|
34
|
-
# @option arguments [
|
35
|
-
# @option arguments [
|
36
|
-
#
|
37
|
-
#
|
38
|
-
# @option arguments [Integer
|
39
|
-
#
|
54
|
+
# @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search.
|
55
|
+
# If +wait_for+, it waits for a refresh to make this operation visible to search.
|
56
|
+
# If +false+, it does nothing with refreshes. Server default: false.
|
57
|
+
# @option arguments [String] :routing A custom value used to route operations to a specific shard.
|
58
|
+
# @option arguments [Time] :timeout The period to wait for active shards.This parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs.
|
59
|
+
# Some reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation.
|
60
|
+
# By default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error. Server default: 1m.
|
61
|
+
# @option arguments [Integer] :version An explicit version number for concurrency control.
|
62
|
+
# It must match the current version of the document for the request to succeed.
|
63
|
+
# @option arguments [String] :version_type The version type.
|
64
|
+
# @option arguments [Integer, String] :wait_for_active_shards The minimum number of shard copies that must be active before proceeding with the operation.
|
65
|
+
# You can set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
|
66
|
+
# The default value of +1+ means it waits for each primary shard to be active. Server default: 1.
|
40
67
|
# @option arguments [Hash] :headers Custom HTTP headers
|
41
68
|
#
|
42
|
-
# @see https://www.elastic.co/
|
69
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete
|
43
70
|
#
|
44
71
|
def delete(arguments = {})
|
45
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
72
|
+
request_opts = { endpoint: arguments[:endpoint] || 'delete' }
|
46
73
|
|
47
|
-
defined_params = [:index, :id].
|
74
|
+
defined_params = [:index, :id].each_with_object({}) do |variable, set_variables|
|
48
75
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
49
|
-
set_variables
|
50
76
|
end
|
51
77
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
52
78
|
|
@@ -67,11 +93,11 @@ module ElasticsearchServerless
|
|
67
93
|
params = Utils.process_params(arguments)
|
68
94
|
|
69
95
|
if Array(arguments[:ignore]).include?(404)
|
70
|
-
Utils.rescue_from_not_found
|
96
|
+
Utils.rescue_from_not_found do
|
71
97
|
ElasticsearchServerless::API::Response.new(
|
72
98
|
perform_request(method, path, params, body, headers, request_opts)
|
73
99
|
)
|
74
|
-
|
100
|
+
end
|
75
101
|
else
|
76
102
|
ElasticsearchServerless::API::Response.new(
|
77
103
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -23,66 +23,128 @@ module ElasticsearchServerless
|
|
23
23
|
module Actions
|
24
24
|
# Delete documents.
|
25
25
|
# Deletes documents that match the specified query.
|
26
|
+
# If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias:
|
27
|
+
# * +read+
|
28
|
+
# * +delete+ or +write+
|
29
|
+
# You can specify the query criteria in the request URI or the request body using the same syntax as the search API.
|
30
|
+
# When you submit a delete by query request, Elasticsearch gets a snapshot of the data stream or index when it begins processing the request and deletes matching documents using internal versioning.
|
31
|
+
# If a document changes between the time that the snapshot is taken and the delete operation is processed, it results in a version conflict and the delete operation fails.
|
32
|
+
# NOTE: Documents with a version equal to 0 cannot be deleted using delete by query because internal versioning does not support 0 as a valid version number.
|
33
|
+
# While processing a delete by query request, Elasticsearch performs multiple search requests sequentially to find all of the matching documents to delete.
|
34
|
+
# A bulk delete request is performed for each batch of matching documents.
|
35
|
+
# If a search or bulk request is rejected, the requests are retried up to 10 times, with exponential back off.
|
36
|
+
# If the maximum retry limit is reached, processing halts and all failed requests are returned in the response.
|
37
|
+
# Any delete requests that completed successfully still stick, they are not rolled back.
|
38
|
+
# You can opt to count version conflicts instead of halting and returning by setting +conflicts+ to +proceed+.
|
39
|
+
# Note that if you opt to count version conflicts the operation could attempt to delete more documents from the source than +max_docs+ until it has successfully deleted +max_docs documents+, or it has gone through every document in the source query.
|
40
|
+
# **Throttling delete requests**
|
41
|
+
# To control the rate at which delete by query issues batches of delete operations, you can set +requests_per_second+ to any positive decimal number.
|
42
|
+
# This pads each batch with a wait time to throttle the rate.
|
43
|
+
# Set +requests_per_second+ to +-1+ to disable throttling.
|
44
|
+
# Throttling uses a wait time between batches so that the internal scroll requests can be given a timeout that takes the request padding into account.
|
45
|
+
# The padding time is the difference between the batch size divided by the +requests_per_second+ and the time spent writing.
|
46
|
+
# By default the batch size is +1000+, so if +requests_per_second+ is set to +500+:
|
47
|
+
# +
|
48
|
+
# target_time = 1000 / 500 per second = 2 seconds
|
49
|
+
# wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
|
50
|
+
# +
|
51
|
+
# Since the batch is issued as a single +_bulk+ request, large batch sizes cause Elasticsearch to create many requests and wait before starting the next set.
|
52
|
+
# This is "bursty" instead of "smooth".
|
53
|
+
# **Slicing**
|
54
|
+
# Delete by query supports sliced scroll to parallelize the delete process.
|
55
|
+
# This can improve efficiency and provide a convenient way to break the request down into smaller parts.
|
56
|
+
# Setting +slices+ to +auto+ lets Elasticsearch choose the number of slices to use.
|
57
|
+
# This setting will use one slice per shard, up to a certain limit.
|
58
|
+
# If there are multiple source data streams or indices, it will choose the number of slices based on the index or backing index with the smallest number of shards.
|
59
|
+
# Adding slices to the delete by query operation creates sub-requests which means it has some quirks:
|
60
|
+
# * You can see these requests in the tasks APIs. These sub-requests are "child" tasks of the task for the request with slices.
|
61
|
+
# * Fetching the status of the task for the request with slices only contains the status of completed slices.
|
62
|
+
# * These sub-requests are individually addressable for things like cancellation and rethrottling.
|
63
|
+
# * Rethrottling the request with +slices+ will rethrottle the unfinished sub-request proportionally.
|
64
|
+
# * Canceling the request with +slices+ will cancel each sub-request.
|
65
|
+
# * 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.
|
66
|
+
# * Parameters like +requests_per_second+ and +max_docs+ on a request with +slices+ are distributed proportionally to each sub-request. Combine that with the earlier point about distribution being uneven and you should conclude that using +max_docs+ with +slices+ might not result in exactly +max_docs+ documents being deleted.
|
67
|
+
# * Each sub-request gets a slightly different snapshot of the source data stream or index though these are all taken at approximately the same time.
|
68
|
+
# If you're slicing manually or otherwise tuning automatic slicing, keep in mind that:
|
69
|
+
# * Query performance is most efficient when the number of slices is equal to the number of shards in the index or backing index. If that number is large (for example, 500), choose a lower number as too many +slices+ hurts performance. Setting +slices+ higher than the number of shards generally does not improve efficiency and adds overhead.
|
70
|
+
# * Delete performance scales linearly across available resources with the number of slices.
|
71
|
+
# Whether query or delete performance dominates the runtime depends on the documents being reindexed and cluster resources.
|
72
|
+
# **Cancel a delete by query operation**
|
73
|
+
# Any delete by query can be canceled using the task cancel API. For example:
|
74
|
+
# +
|
75
|
+
# POST _tasks/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel
|
76
|
+
# +
|
77
|
+
# The task ID can be found by using the get tasks API.
|
78
|
+
# Cancellation should happen quickly but might take a few seconds.
|
79
|
+
# The get task status API will continue to list the delete by query task until this task checks that it has been cancelled and terminates itself.
|
26
80
|
#
|
27
|
-
# @option arguments [String, Array] :index
|
28
|
-
#
|
81
|
+
# @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search.
|
82
|
+
# It supports wildcards (+*+).
|
29
83
|
# To search all data streams or indices, omit this parameter or use +*+ or +_all+. (*Required*)
|
30
84
|
# @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.
|
31
85
|
# This behavior applies even if the request targets other open indices.
|
32
86
|
# 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.
|
33
87
|
# @option arguments [String] :analyzer Analyzer to use for the query string.
|
88
|
+
# This parameter can be used only when the +q+ query string parameter is specified.
|
34
89
|
# @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed.
|
90
|
+
# This parameter can be used only when the +q+ query string parameter is specified.
|
35
91
|
# @option arguments [String] :conflicts What to do if delete by query hits version conflicts: +abort+ or +proceed+. Server default: abort.
|
36
|
-
# @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+.
|
37
|
-
#
|
38
|
-
# @option arguments [String
|
92
|
+
# @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+.
|
93
|
+
# This parameter can be used only when the +q+ query string parameter is specified. Server default: OR.
|
94
|
+
# @option arguments [String] :df The field to use as default where no field prefix is given in the query string.
|
95
|
+
# This parameter can be used only when the +q+ query string parameter is specified.
|
96
|
+
# @option arguments [String, Array<String>] :expand_wildcards The type of index that wildcard patterns can match.
|
39
97
|
# If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
|
40
|
-
#
|
98
|
+
# It supports comma-separated values, such as +open,hidden+. Server default: open.
|
41
99
|
# @option arguments [Integer] :from Starting offset (default: 0)
|
42
100
|
# @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index.
|
43
101
|
# @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
|
44
|
-
#
|
102
|
+
# This parameter can be used only when the +q+ query string parameter is specified.
|
103
|
+
# @option arguments [Integer] :max_docs The maximum number of documents to process.
|
45
104
|
# Defaults to all documents.
|
46
|
-
#
|
47
|
-
#
|
105
|
+
# When set to a value less then or equal to +scroll_size+, a scroll will not be used to retrieve the results for the operation.
|
106
|
+
# @option arguments [String] :preference The node or shard the operation should be performed on.
|
107
|
+
# It is random by default.
|
48
108
|
# @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes all shards involved in the delete by query after the request completes.
|
109
|
+
# This is different than the delete API's +refresh+ parameter, which causes just the shard that received the delete request to be refreshed.
|
110
|
+
# Unlike the delete API, it does not support +wait_for+.
|
49
111
|
# @option arguments [Boolean] :request_cache If +true+, the request cache is used for this request.
|
50
112
|
# Defaults to the index-level setting.
|
51
|
-
# @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second.
|
52
|
-
# @option arguments [String] :routing
|
53
|
-
# @option arguments [String] :q
|
54
|
-
# @option arguments [Time] :scroll
|
55
|
-
# @option arguments [Integer] :scroll_size
|
56
|
-
# @option arguments [Time] :search_timeout
|
57
|
-
#
|
113
|
+
# @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. Server default: -1.
|
114
|
+
# @option arguments [String] :routing A custom value used to route operations to a specific shard.
|
115
|
+
# @option arguments [String] :q A query in the Lucene query string syntax.
|
116
|
+
# @option arguments [Time] :scroll The period to retain the search context for scrolling.
|
117
|
+
# @option arguments [Integer] :scroll_size The size of the scroll request that powers the operation. Server default: 1000.
|
118
|
+
# @option arguments [Time] :search_timeout The explicit timeout for each search request.
|
119
|
+
# It defaults to no timeout.
|
58
120
|
# @option arguments [String] :search_type The type of the search operation.
|
59
|
-
# Available options
|
121
|
+
# Available options include +query_then_fetch+ and +dfs_query_then_fetch+.
|
60
122
|
# @option arguments [Integer, String] :slices The number of slices this task should be divided into. Server default: 1.
|
61
|
-
# @option arguments [Array<String>] :sort A comma-separated list of
|
62
|
-
# @option arguments [Array<String>] :stats
|
63
|
-
# @option arguments [Integer] :terminate_after
|
123
|
+
# @option arguments [Array<String>] :sort A comma-separated list of +<field>:<direction>+ pairs.
|
124
|
+
# @option arguments [Array<String>] :stats The specific +tag+ of the request for logging and statistical purposes.
|
125
|
+
# @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard.
|
64
126
|
# If a query reaches this limit, Elasticsearch terminates the query early.
|
65
|
-
# Elasticsearch collects documents before sorting.
|
66
|
-
# Use with caution.
|
127
|
+
# Elasticsearch collects documents before sorting.Use with caution.
|
67
128
|
# Elasticsearch applies this parameter to each shard handling the request.
|
68
129
|
# When possible, let Elasticsearch perform early termination automatically.
|
69
130
|
# Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
|
70
|
-
# @option arguments [Time] :timeout
|
131
|
+
# @option arguments [Time] :timeout The period each deletion request waits for active shards. Server default: 1m.
|
71
132
|
# @option arguments [Boolean] :version If +true+, returns the document version as part of a hit.
|
72
133
|
# @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation.
|
73
|
-
# Set to all or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
|
74
|
-
#
|
134
|
+
# Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+).
|
135
|
+
# The +timeout+ value controls how long each write request waits for unavailable shards to become available. Server default: 1.
|
136
|
+
# @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete.
|
137
|
+
# If +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. Elasticsearch creates a record of this task as a document at +.tasks/task/${taskId}+. When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space. Server default: true.
|
75
138
|
# @option arguments [Hash] :headers Custom HTTP headers
|
76
139
|
# @option arguments [Hash] :body request body
|
77
140
|
#
|
78
|
-
# @see https://www.elastic.co/
|
141
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query
|
79
142
|
#
|
80
143
|
def delete_by_query(arguments = {})
|
81
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
144
|
+
request_opts = { endpoint: arguments[:endpoint] || 'delete_by_query' }
|
82
145
|
|
83
|
-
defined_params = [:index].
|
146
|
+
defined_params = [:index].each_with_object({}) do |variable, set_variables|
|
84
147
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
85
|
-
set_variables
|
86
148
|
end
|
87
149
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
88
150
|
|
@@ -24,21 +24,22 @@ module ElasticsearchServerless
|
|
24
24
|
# Delete a script or search template.
|
25
25
|
# Deletes a stored script or search template.
|
26
26
|
#
|
27
|
-
# @option arguments [String] :id
|
28
|
-
# @option arguments [Time] :master_timeout
|
29
|
-
# If no response is received before the timeout expires, the request fails and returns an error.
|
30
|
-
#
|
31
|
-
#
|
27
|
+
# @option arguments [String] :id The identifier for the stored script or search template. (*Required*)
|
28
|
+
# @option arguments [Time] :master_timeout The period to wait for a connection to the master node.
|
29
|
+
# If no response is received before the timeout expires, the request fails and returns an error.
|
30
|
+
# It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s.
|
31
|
+
# @option arguments [Time] :timeout The period to wait for a response.
|
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.
|
32
34
|
# @option arguments [Hash] :headers Custom HTTP headers
|
33
35
|
#
|
34
|
-
# @see https://www.elastic.co/
|
36
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script
|
35
37
|
#
|
36
38
|
def delete_script(arguments = {})
|
37
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
39
|
+
request_opts = { endpoint: arguments[:endpoint] || 'delete_script' }
|
38
40
|
|
39
|
-
defined_params = [:id].
|
41
|
+
defined_params = [:id].each_with_object({}) do |variable, set_variables|
|
40
42
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
41
|
-
set_variables
|
42
43
|
end
|
43
44
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
44
45
|
|
@@ -26,16 +26,16 @@ module ElasticsearchServerless
|
|
26
26
|
# Deletes an existing enrich policy and its enrich index.
|
27
27
|
#
|
28
28
|
# @option arguments [String] :name Enrich policy to delete. (*Required*)
|
29
|
+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
|
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-enrich-delete-policy
|
32
33
|
#
|
33
34
|
def delete_policy(arguments = {})
|
34
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
35
|
+
request_opts = { endpoint: arguments[:endpoint] || 'enrich.delete_policy' }
|
35
36
|
|
36
|
-
defined_params = [:name].
|
37
|
+
defined_params = [:name].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
|
|
@@ -50,7 +50,7 @@ module ElasticsearchServerless
|
|
50
50
|
|
51
51
|
method = ElasticsearchServerless::API::HTTP_DELETE
|
52
52
|
path = "_enrich/policy/#{Utils.listify(_name)}"
|
53
|
-
params =
|
53
|
+
params = Utils.process_params(arguments)
|
54
54
|
|
55
55
|
ElasticsearchServerless::API::Response.new(
|
56
56
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -22,20 +22,21 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module Enrich
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Run an enrich policy.
|
26
|
+
# Create the enrich index for an existing enrich policy.
|
26
27
|
#
|
27
28
|
# @option arguments [String] :name Enrich policy to execute. (*Required*)
|
29
|
+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
|
28
30
|
# @option arguments [Boolean] :wait_for_completion If +true+, the request blocks other enrich policy execution requests until complete. Server default: true.
|
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-enrich-execute-policy
|
32
34
|
#
|
33
35
|
def execute_policy(arguments = {})
|
34
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
36
|
+
request_opts = { endpoint: arguments[:endpoint] || 'enrich.execute_policy' }
|
35
37
|
|
36
|
-
defined_params = [:name].
|
38
|
+
defined_params = [:name].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
|
|
@@ -27,16 +27,16 @@ module ElasticsearchServerless
|
|
27
27
|
#
|
28
28
|
# @option arguments [String, Array<String>] :name Comma-separated list of enrich policy names used to limit the request.
|
29
29
|
# To return information for all enrich policies, omit this parameter.
|
30
|
+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
|
30
31
|
# @option arguments [Hash] :headers Custom HTTP headers
|
31
32
|
#
|
32
|
-
# @see https://www.elastic.co/
|
33
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-get-policy
|
33
34
|
#
|
34
35
|
def get_policy(arguments = {})
|
35
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
36
|
+
request_opts = { endpoint: arguments[:endpoint] || 'enrich.get_policy' }
|
36
37
|
|
37
|
-
defined_params = [:name].
|
38
|
+
defined_params = [:name].each_with_object({}) do |variable, set_variables|
|
38
39
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
39
|
-
set_variables
|
40
40
|
end
|
41
41
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
42
42
|
|
@@ -51,9 +51,9 @@ module ElasticsearchServerless
|
|
51
51
|
path = if _name
|
52
52
|
"_enrich/policy/#{Utils.listify(_name)}"
|
53
53
|
else
|
54
|
-
|
54
|
+
'_enrich/policy'
|
55
55
|
end
|
56
|
-
params =
|
56
|
+
params = Utils.process_params(arguments)
|
57
57
|
|
58
58
|
ElasticsearchServerless::API::Response.new(
|
59
59
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -26,17 +26,17 @@ module ElasticsearchServerless
|
|
26
26
|
# Creates an enrich policy.
|
27
27
|
#
|
28
28
|
# @option arguments [String] :name Name of the enrich policy to create or update. (*Required*)
|
29
|
+
# @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
|
29
30
|
# @option arguments [Hash] :headers Custom HTTP headers
|
30
31
|
# @option arguments [Hash] :body request body
|
31
32
|
#
|
32
|
-
# @see https://www.elastic.co/
|
33
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-put-policy
|
33
34
|
#
|
34
35
|
def put_policy(arguments = {})
|
35
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
36
|
+
request_opts = { endpoint: arguments[:endpoint] || 'enrich.put_policy' }
|
36
37
|
|
37
|
-
defined_params = [:name].
|
38
|
+
defined_params = [:name].each_with_object({}) do |variable, set_variables|
|
38
39
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
39
|
-
set_variables
|
40
40
|
end
|
41
41
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
42
42
|
|
@@ -52,7 +52,7 @@ module ElasticsearchServerless
|
|
52
52
|
|
53
53
|
method = ElasticsearchServerless::API::HTTP_PUT
|
54
54
|
path = "_enrich/policy/#{Utils.listify(_name)}"
|
55
|
-
params =
|
55
|
+
params = Utils.process_params(arguments)
|
56
56
|
|
57
57
|
ElasticsearchServerless::API::Response.new(
|
58
58
|
perform_request(method, path, params, body, headers, request_opts)
|
@@ -22,7 +22,8 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module Eql
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Delete an async EQL search.
|
26
|
+
# Delete an async EQL search or a stored synchronous EQL search.
|
26
27
|
# The API also deletes results for the search.
|
27
28
|
#
|
28
29
|
# @option arguments [String] :id Identifier for the search to delete.
|
@@ -30,14 +31,13 @@ module ElasticsearchServerless
|
|
30
31
|
# A search ID is also provided if the request’s +keep_on_completion+ parameter is +true+. (*Required*)
|
31
32
|
# @option arguments [Hash] :headers Custom HTTP headers
|
32
33
|
#
|
33
|
-
# @see https://www.elastic.co/
|
34
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-delete
|
34
35
|
#
|
35
36
|
def delete(arguments = {})
|
36
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
37
|
+
request_opts = { endpoint: arguments[:endpoint] || 'eql.delete' }
|
37
38
|
|
38
|
-
defined_params = [:id].
|
39
|
+
defined_params = [:id].each_with_object({}) do |variable, set_variables|
|
39
40
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
40
|
-
set_variables
|
41
41
|
end
|
42
42
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
43
43
|
|
@@ -22,7 +22,8 @@ module ElasticsearchServerless
|
|
22
22
|
module API
|
23
23
|
module Eql
|
24
24
|
module Actions
|
25
|
-
#
|
25
|
+
# Get async EQL search results.
|
26
|
+
# Get the current status and available results for an async EQL search or a stored synchronous EQL search.
|
26
27
|
#
|
27
28
|
# @option arguments [String] :id Identifier for the search. (*Required*)
|
28
29
|
# @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster.
|
@@ -31,14 +32,13 @@ module ElasticsearchServerless
|
|
31
32
|
# Defaults to no timeout, meaning the request waits for complete search results.
|
32
33
|
# @option arguments [Hash] :headers Custom HTTP headers
|
33
34
|
#
|
34
|
-
# @see https://www.elastic.co/
|
35
|
+
# @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get
|
35
36
|
#
|
36
37
|
def get(arguments = {})
|
37
|
-
request_opts = { endpoint: arguments[:endpoint] ||
|
38
|
+
request_opts = { endpoint: arguments[:endpoint] || 'eql.get' }
|
38
39
|
|
39
|
-
defined_params = [:id].
|
40
|
+
defined_params = [:id].each_with_object({}) do |variable, set_variables|
|
40
41
|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
|
41
|
-
set_variables
|
42
42
|
end
|
43
43
|
request_opts[:defined_params] = defined_params unless defined_params.empty?
|
44
44
|
|