elasticsearch-api 7.8.0.pre → 7.10.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE → LICENSE.txt} +0 -0
- data/README.md +18 -2
- data/elasticsearch-api.gemspec +2 -2
- data/lib/elasticsearch/api.rb +2 -1
- data/lib/elasticsearch/api/actions/bulk.rb +10 -10
- data/lib/elasticsearch/api/actions/cat/aliases.rb +4 -6
- data/lib/elasticsearch/api/actions/cat/allocation.rb +4 -6
- data/lib/elasticsearch/api/actions/cat/count.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +4 -7
- data/lib/elasticsearch/api/actions/cat/health.rb +3 -5
- data/lib/elasticsearch/api/actions/cat/help.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/indices.rb +7 -15
- data/lib/elasticsearch/api/actions/cat/master.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/nodes.rb +5 -9
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +3 -5
- data/lib/elasticsearch/api/actions/cat/plugins.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/recovery.rb +5 -10
- data/lib/elasticsearch/api/actions/cat/repositories.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/segments.rb +4 -6
- data/lib/elasticsearch/api/actions/cat/shards.rb +5 -9
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +4 -6
- data/lib/elasticsearch/api/actions/cat/tasks.rb +3 -5
- data/lib/elasticsearch/api/actions/cat/templates.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +4 -6
- data/lib/elasticsearch/api/actions/clear_scroll.rb +4 -4
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +9 -4
- data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +6 -2
- data/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/exists_component_template.rb +6 -2
- data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +7 -3
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/health.rb +7 -15
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/put_component_template.rb +6 -2
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +3 -5
- data/lib/elasticsearch/api/actions/cluster/state.rb +5 -9
- data/lib/elasticsearch/api/actions/cluster/stats.rb +3 -3
- data/lib/elasticsearch/api/actions/count.rb +11 -20
- data/lib/elasticsearch/api/actions/create.rb +5 -9
- data/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb +60 -0
- data/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb +60 -0
- data/lib/elasticsearch/api/actions/{indices/get_data_streams.rb → dangling_indices/list_dangling_indices.rb} +6 -13
- data/lib/elasticsearch/api/actions/dangling_indices/params_registry.rb +60 -0
- data/lib/elasticsearch/api/actions/delete.rb +6 -10
- data/lib/elasticsearch/api/actions/delete_by_query.rb +8 -16
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +3 -3
- data/lib/elasticsearch/api/actions/delete_script.rb +2 -2
- data/lib/elasticsearch/api/actions/exists.rb +5 -7
- data/lib/elasticsearch/api/actions/exists_source.rb +5 -7
- data/lib/elasticsearch/api/actions/explain.rb +14 -11
- data/lib/elasticsearch/api/actions/field_caps.rb +15 -11
- data/lib/elasticsearch/api/actions/get.rb +5 -7
- data/lib/elasticsearch/api/actions/get_script.rb +2 -2
- data/lib/elasticsearch/api/actions/get_script_context.rb +6 -2
- data/lib/elasticsearch/api/actions/get_script_languages.rb +6 -2
- data/lib/elasticsearch/api/actions/get_source.rb +5 -7
- data/lib/elasticsearch/api/actions/index.rb +10 -14
- data/lib/elasticsearch/api/actions/indices/add_block.rb +68 -0
- data/lib/elasticsearch/api/actions/indices/analyze.rb +12 -8
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +4 -7
- data/lib/elasticsearch/api/actions/indices/clone.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/close.rb +3 -5
- data/lib/elasticsearch/api/actions/indices/create.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/delete.rb +3 -5
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/delete_index_template.rb +6 -2
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/exists.rb +3 -5
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/exists_index_template.rb +6 -2
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +3 -5
- data/lib/elasticsearch/api/actions/indices/flush.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +9 -6
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/get.rb +3 -5
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +5 -7
- data/lib/elasticsearch/api/actions/indices/get_index_template.rb +7 -3
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +6 -8
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/get_template.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/open.rb +3 -5
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/put_index_template.rb +6 -2
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +8 -8
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/put_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/recovery.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/refresh.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/{delete_data_stream.rb → resolve_index.rb} +20 -8
- data/lib/elasticsearch/api/actions/indices/rollover.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/segments.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +5 -9
- data/lib/elasticsearch/api/actions/indices/shrink.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/simulate_index_template.rb +6 -2
- data/lib/elasticsearch/api/actions/indices/simulate_template.rb +67 -0
- data/lib/elasticsearch/api/actions/indices/split.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/stats.rb +5 -11
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +4 -6
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +17 -16
- data/lib/elasticsearch/api/actions/info.rb +2 -2
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +2 -2
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +3 -3
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +2 -2
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +2 -2
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +4 -4
- data/lib/elasticsearch/api/actions/mget.rb +5 -5
- data/lib/elasticsearch/api/actions/msearch.rb +8 -12
- data/lib/elasticsearch/api/actions/msearch_template.rb +6 -8
- data/lib/elasticsearch/api/actions/mtermvectors.rb +16 -13
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -6
- data/lib/elasticsearch/api/actions/nodes/info.rb +4 -6
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/nodes/stats.rb +6 -12
- data/lib/elasticsearch/api/actions/nodes/usage.rb +4 -6
- data/lib/elasticsearch/api/actions/ping.rb +2 -2
- data/lib/elasticsearch/api/actions/put_script.rb +3 -4
- data/lib/elasticsearch/api/actions/rank_eval.rb +10 -10
- data/lib/elasticsearch/api/actions/reindex.rb +2 -2
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +3 -3
- data/lib/elasticsearch/api/actions/render_search_template.rb +12 -7
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +13 -4
- data/lib/elasticsearch/api/actions/scroll.rb +13 -9
- data/lib/elasticsearch/api/actions/search.rb +18 -21
- data/lib/elasticsearch/api/actions/search_shards.rb +4 -6
- data/lib/elasticsearch/api/actions/search_template.rb +6 -10
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/clone.rb +66 -0
- data/lib/elasticsearch/api/actions/snapshot/create.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/get.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +2 -2
- data/lib/elasticsearch/api/actions/snapshot/status.rb +3 -3
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +2 -2
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +3 -3
- data/lib/elasticsearch/api/actions/tasks/get.rb +2 -2
- data/lib/elasticsearch/api/actions/tasks/list.rb +3 -5
- data/lib/elasticsearch/api/actions/termvectors.rb +10 -8
- data/lib/elasticsearch/api/actions/update.rb +8 -8
- data/lib/elasticsearch/api/actions/update_by_query.rb +8 -16
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +3 -3
- data/lib/elasticsearch/api/namespace/cat.rb +0 -1
- data/lib/elasticsearch/api/namespace/dangling_indices.rb +35 -0
- data/lib/elasticsearch/api/version.rb +1 -1
- data/spec/elasticsearch/api/actions/count_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/dangling_indices/delete_dangling_indices_spec.rb +48 -0
- data/spec/elasticsearch/api/actions/dangling_indices/import_dangling_indices_spec.rb +48 -0
- data/spec/elasticsearch/api/actions/dangling_indices/list_dangling_indices_spec.rb +36 -0
- data/spec/elasticsearch/api/actions/explain_document_spec.rb +8 -9
- data/spec/elasticsearch/api/actions/indices/add_block_spec.rb +63 -0
- data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +7 -8
- data/spec/elasticsearch/api/actions/indices/validate_query_spec.rb +7 -13
- data/spec/elasticsearch/api/actions/ingest/simulate_spec.rb +6 -7
- data/spec/elasticsearch/api/actions/json_builders_spec.rb +10 -13
- data/spec/elasticsearch/api/actions/mget_spec.rb +5 -6
- data/spec/elasticsearch/api/actions/msearch_spec.rb +21 -39
- data/spec/elasticsearch/api/actions/msearch_template_spec.rb +5 -6
- data/spec/elasticsearch/api/actions/mtermvectors_spec.rb +7 -7
- data/spec/elasticsearch/api/actions/render_search_template_spec.rb +2 -2
- data/spec/elasticsearch/api/actions/scroll_spec.rb +1 -1
- data/spec/elasticsearch/api/actions/search_spec.rb +7 -7
- data/spec/elasticsearch/api/actions/search_template_spec.rb +5 -6
- data/spec/elasticsearch/api/actions/snapshot/clone_spec.rb +67 -0
- data/spec/elasticsearch/api/actions/termvectors_spec.rb +5 -7
- data/spec/elasticsearch/api/rest_api_yaml_spec.rb +0 -1
- data/utils/thor/.rubocop.yml +2 -0
- data/utils/thor/generate_source.rb +54 -19
- data/utils/thor/generator/endpoint_specifics.rb +10 -3
- data/utils/thor/templates/_documentation_top.erb +13 -2
- metadata +24 -13
- data/lib/elasticsearch/api/actions/indices/create_data_stream.rb +0 -50
- data/spec/README.md +0 -61
- data/test/integration/yaml_test_runner.rb +0 -592
- data/test/test_helper.rb +0 -118
@@ -17,34 +17,27 @@
|
|
17
17
|
|
18
18
|
module Elasticsearch
|
19
19
|
module API
|
20
|
-
module
|
20
|
+
module DanglingIndices
|
21
21
|
module Actions
|
22
|
-
# Returns
|
22
|
+
# Returns all dangling indices.
|
23
23
|
#
|
24
|
-
# @option arguments [String] :name The name or wildcard expression of the requested data streams
|
25
24
|
# @option arguments [Hash] :headers Custom HTTP headers
|
26
25
|
#
|
27
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
26
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-gateway-dangling-indices.html
|
28
27
|
#
|
29
|
-
def
|
28
|
+
def list_dangling_indices(arguments = {})
|
30
29
|
headers = arguments.delete(:headers) || {}
|
31
30
|
|
32
31
|
arguments = arguments.clone
|
33
32
|
|
34
|
-
_name = arguments.delete(:name)
|
35
|
-
|
36
33
|
method = Elasticsearch::API::HTTP_GET
|
37
|
-
path =
|
38
|
-
"_data_streams/#{Utils.__listify(_name)}"
|
39
|
-
else
|
40
|
-
"_data_streams"
|
41
|
-
end
|
34
|
+
path = "_dangling"
|
42
35
|
params = {}
|
43
36
|
|
44
37
|
body = nil
|
45
38
|
perform_request(method, path, params, body, headers).body
|
46
39
|
end
|
47
|
-
end
|
48
40
|
end
|
41
|
+
end
|
49
42
|
end
|
50
43
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
module Elasticsearch
|
19
|
+
module API
|
20
|
+
module DanglingIndices
|
21
|
+
module Actions
|
22
|
+
module ParamsRegistry
|
23
|
+
extend self
|
24
|
+
|
25
|
+
# A Mapping of all the actions to their list of valid params.
|
26
|
+
#
|
27
|
+
# @since 6.1.1
|
28
|
+
PARAMS = {}
|
29
|
+
|
30
|
+
# Register an action with its list of valid params.
|
31
|
+
#
|
32
|
+
# @example Register the action.
|
33
|
+
# ParamsRegistry.register(:benchmark, [ :verbose ])
|
34
|
+
#
|
35
|
+
# @param [ Symbol ] action The action to register.
|
36
|
+
# @param [ Array[Symbol] ] valid_params The list of valid params.
|
37
|
+
#
|
38
|
+
# @since 6.1.1
|
39
|
+
def register(action, valid_params)
|
40
|
+
PARAMS[action.to_sym] = valid_params
|
41
|
+
end
|
42
|
+
|
43
|
+
# Get the list of valid params for a given action.
|
44
|
+
#
|
45
|
+
# @example Get the list of valid params.
|
46
|
+
# ParamsRegistry.get(:benchmark)
|
47
|
+
#
|
48
|
+
# @param [ Symbol ] action The action.
|
49
|
+
#
|
50
|
+
# @return [ Array<Symbol> ] The list of valid params for the action.
|
51
|
+
#
|
52
|
+
# @since 6.1.1
|
53
|
+
def get(action)
|
54
|
+
PARAMS.fetch(action, [])
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -22,19 +22,15 @@ module Elasticsearch
|
|
22
22
|
#
|
23
23
|
# @option arguments [String] :id The document ID
|
24
24
|
# @option arguments [String] :index The name of the index
|
25
|
-
# @option arguments [String] :type The type of the document
|
25
|
+
# @option arguments [String] :type The type of the document *Deprecated*
|
26
26
|
# @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
27
|
-
# @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
|
28
|
-
# (options: true,false,wait_for)
|
29
|
-
|
27
|
+
# @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for)
|
30
28
|
# @option arguments [String] :routing Specific routing value
|
31
29
|
# @option arguments [Time] :timeout Explicit operation timeout
|
32
30
|
# @option arguments [Number] :if_seq_no only perform the delete operation if the last operation that has changed the document has the specified sequence number
|
33
31
|
# @option arguments [Number] :if_primary_term only perform the delete operation if the last operation that has changed the document has the specified primary term
|
34
32
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
35
|
-
# @option arguments [String] :version_type Specific version type
|
36
|
-
# (options: internal,external,external_gte,force)
|
37
|
-
|
33
|
+
# @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
|
38
34
|
# @option arguments [Hash] :headers Custom HTTP headers
|
39
35
|
#
|
40
36
|
# *Deprecation notice*:
|
@@ -42,7 +38,7 @@ module Elasticsearch
|
|
42
38
|
# Deprecated since version 7.0.0
|
43
39
|
#
|
44
40
|
#
|
45
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
41
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-delete.html
|
46
42
|
#
|
47
43
|
def delete(arguments = {})
|
48
44
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -63,7 +59,7 @@ module Elasticsearch
|
|
63
59
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
|
64
60
|
else
|
65
61
|
"#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
|
66
|
-
|
62
|
+
end
|
67
63
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
68
64
|
|
69
65
|
body = nil
|
@@ -88,5 +84,5 @@ module Elasticsearch
|
|
88
84
|
:version_type
|
89
85
|
].freeze)
|
90
86
|
end
|
91
|
-
|
87
|
+
end
|
92
88
|
end
|
@@ -20,31 +20,23 @@ module Elasticsearch
|
|
20
20
|
module Actions
|
21
21
|
# Deletes documents matching the provided query.
|
22
22
|
#
|
23
|
-
# @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
23
|
+
# @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices (*Required*)
|
24
24
|
# @option arguments [List] :type A comma-separated list of document types to search; leave empty to perform the operation on all types
|
25
25
|
# @option arguments [String] :analyzer The analyzer to use for the query string
|
26
26
|
# @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false)
|
27
|
-
# @option arguments [String] :default_operator The default operator for query string query (AND or OR)
|
28
|
-
# (options: AND,OR)
|
29
|
-
|
27
|
+
# @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR)
|
30
28
|
# @option arguments [String] :df The field to use as default where no field prefix is given in the query string
|
31
29
|
# @option arguments [Number] :from Starting offset (default: 0)
|
32
30
|
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
33
31
|
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
34
|
-
# @option arguments [String] :conflicts What to do when the delete by query hits version conflicts?
|
35
|
-
#
|
36
|
-
|
37
|
-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
38
|
-
# (options: open,closed,hidden,none,all)
|
39
|
-
|
32
|
+
# @option arguments [String] :conflicts What to do when the delete by query hits version conflicts? (options: abort, proceed)
|
33
|
+
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
|
40
34
|
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
41
35
|
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
|
42
36
|
# @option arguments [String] :q Query in the Lucene query string syntax
|
43
37
|
# @option arguments [List] :routing A comma-separated list of specific routing values
|
44
38
|
# @option arguments [Time] :scroll Specify how long a consistent view of the index should be maintained for scrolled search
|
45
|
-
# @option arguments [String] :search_type Search operation type
|
46
|
-
# (options: query_then_fetch,dfs_query_then_fetch)
|
47
|
-
|
39
|
+
# @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch)
|
48
40
|
# @option arguments [Time] :search_timeout Explicit timeout for each search request. Defaults to no timeout.
|
49
41
|
# @option arguments [Number] :size Deprecated, please use `max_docs` instead
|
50
42
|
# @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents)
|
@@ -71,7 +63,7 @@ module Elasticsearch
|
|
71
63
|
# Deprecated since version 7.0.0
|
72
64
|
#
|
73
65
|
#
|
74
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
66
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-delete-by-query.html
|
75
67
|
#
|
76
68
|
def delete_by_query(arguments = {})
|
77
69
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
@@ -90,7 +82,7 @@ module Elasticsearch
|
|
90
82
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_delete_by_query"
|
91
83
|
else
|
92
84
|
"#{Utils.__listify(_index)}/_delete_by_query"
|
93
|
-
|
85
|
+
end
|
94
86
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
95
87
|
|
96
88
|
body = arguments[:body]
|
@@ -136,5 +128,5 @@ module Elasticsearch
|
|
136
128
|
:slices
|
137
129
|
].freeze)
|
138
130
|
end
|
139
|
-
|
131
|
+
end
|
140
132
|
end
|
@@ -21,10 +21,10 @@ module Elasticsearch
|
|
21
21
|
# Changes the number of requests per second for a particular Delete By Query operation.
|
22
22
|
#
|
23
23
|
# @option arguments [String] :task_id The task id to rethrottle
|
24
|
-
# @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
|
24
|
+
# @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (*Required*)
|
25
25
|
# @option arguments [Hash] :headers Custom HTTP headers
|
26
26
|
#
|
27
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
27
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-delete-by-query.html
|
28
28
|
#
|
29
29
|
def delete_by_query_rethrottle(arguments = {})
|
30
30
|
raise ArgumentError, "Required argument 'task_id' missing" unless arguments[:task_id]
|
@@ -50,5 +50,5 @@ module Elasticsearch
|
|
50
50
|
:requests_per_second
|
51
51
|
].freeze)
|
52
52
|
end
|
53
|
-
|
53
|
+
end
|
54
54
|
end
|
@@ -25,7 +25,7 @@ module Elasticsearch
|
|
25
25
|
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
26
26
|
# @option arguments [Hash] :headers Custom HTTP headers
|
27
27
|
#
|
28
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
28
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-scripting.html
|
29
29
|
#
|
30
30
|
def delete_script(arguments = {})
|
31
31
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
@@ -52,5 +52,5 @@ module Elasticsearch
|
|
52
52
|
:master_timeout
|
53
53
|
].freeze)
|
54
54
|
end
|
55
|
-
|
55
|
+
end
|
56
56
|
end
|
@@ -22,7 +22,7 @@ module Elasticsearch
|
|
22
22
|
#
|
23
23
|
# @option arguments [String] :id The document ID
|
24
24
|
# @option arguments [String] :index The name of the index
|
25
|
-
# @option arguments [String] :type The type of the document (use `_all` to fetch the first document matching the ID across all types)
|
25
|
+
# @option arguments [String] :type The type of the document (use `_all` to fetch the first document matching the ID across all types) *Deprecated*
|
26
26
|
# @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
|
27
27
|
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
|
28
28
|
# @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
|
@@ -32,9 +32,7 @@ module Elasticsearch
|
|
32
32
|
# @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
|
33
33
|
# @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
|
34
34
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
35
|
-
# @option arguments [String] :version_type Specific version type
|
36
|
-
# (options: internal,external,external_gte,force)
|
37
|
-
|
35
|
+
# @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
|
38
36
|
# @option arguments [Hash] :headers Custom HTTP headers
|
39
37
|
#
|
40
38
|
# *Deprecation notice*:
|
@@ -42,7 +40,7 @@ module Elasticsearch
|
|
42
40
|
# Deprecated since version 7.0.0
|
43
41
|
#
|
44
42
|
#
|
45
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
43
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-get.html
|
46
44
|
#
|
47
45
|
def exists(arguments = {})
|
48
46
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -63,7 +61,7 @@ module Elasticsearch
|
|
63
61
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
|
64
62
|
else
|
65
63
|
"#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
|
66
|
-
|
64
|
+
end
|
67
65
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
68
66
|
|
69
67
|
body = nil
|
@@ -90,5 +88,5 @@ module Elasticsearch
|
|
90
88
|
:version_type
|
91
89
|
].freeze)
|
92
90
|
end
|
93
|
-
|
91
|
+
end
|
94
92
|
end
|
@@ -22,7 +22,7 @@ module Elasticsearch
|
|
22
22
|
#
|
23
23
|
# @option arguments [String] :id The document ID
|
24
24
|
# @option arguments [String] :index The name of the index
|
25
|
-
# @option arguments [String] :type The type of the document; deprecated and optional starting with 7.0
|
25
|
+
# @option arguments [String] :type The type of the document; deprecated and optional starting with 7.0 *Deprecated*
|
26
26
|
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
|
27
27
|
# @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
|
28
28
|
# @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation
|
@@ -31,9 +31,7 @@ module Elasticsearch
|
|
31
31
|
# @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
|
32
32
|
# @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
|
33
33
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
34
|
-
# @option arguments [String] :version_type Specific version type
|
35
|
-
# (options: internal,external,external_gte,force)
|
36
|
-
|
34
|
+
# @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
|
37
35
|
# @option arguments [Hash] :headers Custom HTTP headers
|
38
36
|
#
|
39
37
|
# *Deprecation notice*:
|
@@ -41,7 +39,7 @@ module Elasticsearch
|
|
41
39
|
# Deprecated since version 7.0.0
|
42
40
|
#
|
43
41
|
#
|
44
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
42
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-get.html
|
45
43
|
#
|
46
44
|
def exists_source(arguments = {})
|
47
45
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -62,7 +60,7 @@ module Elasticsearch
|
|
62
60
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_source"
|
63
61
|
else
|
64
62
|
"#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}"
|
65
|
-
|
63
|
+
end
|
66
64
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
67
65
|
|
68
66
|
body = nil
|
@@ -85,5 +83,5 @@ module Elasticsearch
|
|
85
83
|
:version_type
|
86
84
|
].freeze)
|
87
85
|
end
|
88
|
-
|
86
|
+
end
|
89
87
|
end
|
@@ -22,12 +22,10 @@ module Elasticsearch
|
|
22
22
|
#
|
23
23
|
# @option arguments [String] :id The document ID
|
24
24
|
# @option arguments [String] :index The name of the index
|
25
|
-
# @option arguments [String] :type The type of the document
|
25
|
+
# @option arguments [String] :type The type of the document *Deprecated*
|
26
26
|
# @option arguments [Boolean] :analyze_wildcard Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
|
27
27
|
# @option arguments [String] :analyzer The analyzer for the query string query
|
28
|
-
# @option arguments [String] :default_operator The default operator for query string query (AND or OR)
|
29
|
-
# (options: AND,OR)
|
30
|
-
|
28
|
+
# @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR)
|
31
29
|
# @option arguments [String] :df The default field for query string query (default: _all)
|
32
30
|
# @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
|
33
31
|
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
@@ -45,7 +43,7 @@ module Elasticsearch
|
|
45
43
|
# Deprecated since version 7.0.0
|
46
44
|
#
|
47
45
|
#
|
48
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
46
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/search-explain.html
|
49
47
|
#
|
50
48
|
def explain(arguments = {})
|
51
49
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -61,12 +59,17 @@ module Elasticsearch
|
|
61
59
|
|
62
60
|
_type = arguments.delete(:type)
|
63
61
|
|
64
|
-
method =
|
65
|
-
|
66
|
-
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_explain"
|
62
|
+
method = if arguments[:body]
|
63
|
+
Elasticsearch::API::HTTP_POST
|
67
64
|
else
|
68
|
-
|
69
|
-
|
65
|
+
Elasticsearch::API::HTTP_GET
|
66
|
+
end
|
67
|
+
|
68
|
+
path = if _index && _type && _id
|
69
|
+
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_explain"
|
70
|
+
else
|
71
|
+
"#{Utils.__listify(_index)}/_explain/#{Utils.__listify(_id)}"
|
72
|
+
end
|
70
73
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
71
74
|
|
72
75
|
body = arguments[:body]
|
@@ -91,5 +94,5 @@ module Elasticsearch
|
|
91
94
|
:_source_includes
|
92
95
|
].freeze)
|
93
96
|
end
|
94
|
-
|
97
|
+
end
|
95
98
|
end
|
@@ -24,13 +24,12 @@ module Elasticsearch
|
|
24
24
|
# @option arguments [List] :fields A comma-separated list of field names
|
25
25
|
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
26
26
|
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
27
|
-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
28
|
-
# (options: open,closed,hidden,none,all)
|
29
|
-
|
27
|
+
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
|
30
28
|
# @option arguments [Boolean] :include_unmapped Indicates whether unmapped fields should be included in the response.
|
31
29
|
# @option arguments [Hash] :headers Custom HTTP headers
|
30
|
+
# @option arguments [Hash] :body An index filter specified with the Query DSL
|
32
31
|
#
|
33
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
32
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/search-field-caps.html
|
34
33
|
#
|
35
34
|
def field_caps(arguments = {})
|
36
35
|
headers = arguments.delete(:headers) || {}
|
@@ -39,15 +38,20 @@ module Elasticsearch
|
|
39
38
|
|
40
39
|
_index = arguments.delete(:index)
|
41
40
|
|
42
|
-
method =
|
43
|
-
|
44
|
-
"#{Utils.__listify(_index)}/_field_caps"
|
41
|
+
method = if arguments[:body]
|
42
|
+
Elasticsearch::API::HTTP_POST
|
45
43
|
else
|
46
|
-
|
47
|
-
|
44
|
+
Elasticsearch::API::HTTP_GET
|
45
|
+
end
|
46
|
+
|
47
|
+
path = if _index
|
48
|
+
"#{Utils.__listify(_index)}/_field_caps"
|
49
|
+
else
|
50
|
+
"_field_caps"
|
51
|
+
end
|
48
52
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
49
53
|
|
50
|
-
body =
|
54
|
+
body = arguments[:body]
|
51
55
|
perform_request(method, path, params, body, headers).body
|
52
56
|
end
|
53
57
|
|
@@ -62,5 +66,5 @@ module Elasticsearch
|
|
62
66
|
:include_unmapped
|
63
67
|
].freeze)
|
64
68
|
end
|
65
|
-
|
69
|
+
end
|
66
70
|
end
|
@@ -22,7 +22,7 @@ module Elasticsearch
|
|
22
22
|
#
|
23
23
|
# @option arguments [String] :id The document ID
|
24
24
|
# @option arguments [String] :index The name of the index
|
25
|
-
# @option arguments [String] :type The type of the document (use `_all` to fetch the first document matching the ID across all types)
|
25
|
+
# @option arguments [String] :type The type of the document (use `_all` to fetch the first document matching the ID across all types) *Deprecated*
|
26
26
|
# @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
|
27
27
|
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
|
28
28
|
# @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
|
@@ -32,9 +32,7 @@ module Elasticsearch
|
|
32
32
|
# @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
|
33
33
|
# @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
|
34
34
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
35
|
-
# @option arguments [String] :version_type Specific version type
|
36
|
-
# (options: internal,external,external_gte,force)
|
37
|
-
|
35
|
+
# @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
|
38
36
|
# @option arguments [Hash] :headers Custom HTTP headers
|
39
37
|
#
|
40
38
|
# *Deprecation notice*:
|
@@ -42,7 +40,7 @@ module Elasticsearch
|
|
42
40
|
# Deprecated since version 7.0.0
|
43
41
|
#
|
44
42
|
#
|
45
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
43
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docs-get.html
|
46
44
|
#
|
47
45
|
def get(arguments = {})
|
48
46
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -63,7 +61,7 @@ module Elasticsearch
|
|
63
61
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
|
64
62
|
else
|
65
63
|
"#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
|
66
|
-
|
64
|
+
end
|
67
65
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
68
66
|
|
69
67
|
body = nil
|
@@ -90,5 +88,5 @@ module Elasticsearch
|
|
90
88
|
:version_type
|
91
89
|
].freeze)
|
92
90
|
end
|
93
|
-
|
91
|
+
end
|
94
92
|
end
|