elasticsearch-api 7.8.1 → 7.9.0.pre
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/api.rb +2 -1
- data/lib/elasticsearch/api/actions/bulk.rb +7 -5
- data/lib/elasticsearch/api/actions/cat/aliases.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/allocation.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/count.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/health.rb +3 -2
- data/lib/elasticsearch/api/actions/cat/help.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/indices.rb +7 -3
- 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 +4 -2
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +3 -2
- data/lib/elasticsearch/api/actions/cat/plugins.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/recovery.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/repositories.rb +2 -2
- data/lib/elasticsearch/api/actions/cat/segments.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/shards.rb +5 -3
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +4 -3
- data/lib/elasticsearch/api/actions/cat/tasks.rb +3 -2
- data/lib/elasticsearch/api/actions/cat/templates.rb +3 -3
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +4 -3
- data/lib/elasticsearch/api/actions/clear_scroll.rb +3 -3
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +9 -4
- data/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +2 -6
- data/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/exists_component_template.rb +2 -6
- data/lib/elasticsearch/api/actions/cluster/get_component_template.rb +3 -7
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +2 -2
- data/lib/elasticsearch/api/actions/cluster/health.rb +7 -3
- 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 +2 -6
- 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 -2
- data/lib/elasticsearch/api/actions/cluster/state.rb +5 -3
- data/lib/elasticsearch/api/actions/cluster/stats.rb +3 -3
- data/lib/elasticsearch/api/actions/count.rb +11 -14
- data/lib/elasticsearch/api/actions/create.rb +4 -2
- 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/dangling_indices/list_dangling_indices.rb +43 -0
- data/lib/elasticsearch/api/actions/dangling_indices/params_registry.rb +60 -0
- data/lib/elasticsearch/api/actions/delete.rb +5 -3
- data/lib/elasticsearch/api/actions/delete_by_query.rb +7 -3
- data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +2 -2
- data/lib/elasticsearch/api/actions/delete_script.rb +2 -2
- data/lib/elasticsearch/api/actions/exists.rb +4 -3
- data/lib/elasticsearch/api/actions/exists_source.rb +4 -3
- data/lib/elasticsearch/api/actions/explain.rb +13 -7
- data/lib/elasticsearch/api/actions/field_caps.rb +15 -8
- data/lib/elasticsearch/api/actions/get.rb +4 -3
- data/lib/elasticsearch/api/actions/get_script.rb +2 -2
- data/lib/elasticsearch/api/actions/get_script_context.rb +2 -6
- data/lib/elasticsearch/api/actions/get_script_languages.rb +2 -6
- data/lib/elasticsearch/api/actions/get_source.rb +4 -3
- data/lib/elasticsearch/api/actions/index.rb +6 -3
- data/lib/elasticsearch/api/actions/indices/add_block.rb +70 -0
- data/lib/elasticsearch/api/actions/indices/analyze.rb +12 -7
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/clone.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/close.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/create.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/create_data_stream.rb +3 -8
- data/lib/elasticsearch/api/actions/indices/data_streams_stats.rb +62 -0
- data/lib/elasticsearch/api/actions/indices/delete.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/delete_data_stream.rb +3 -7
- data/lib/elasticsearch/api/actions/indices/delete_index_template.rb +2 -6
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/exists.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/exists_index_template.rb +2 -6
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/flush.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/get.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/{get_data_streams.rb → get_data_stream.rb} +7 -11
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/get_index_template.rb +3 -7
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +5 -4
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/get_template.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/get_upgrade.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/open.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/put_index_template.rb +2 -6
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +7 -4
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +4 -3
- 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 -3
- data/lib/elasticsearch/api/actions/indices/resolve_index.rb +58 -0
- data/lib/elasticsearch/api/actions/indices/rollover.rb +3 -3
- data/lib/elasticsearch/api/actions/indices/segments.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/shrink.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/simulate_index_template.rb +2 -6
- data/lib/elasticsearch/api/actions/indices/simulate_template.rb +63 -0
- data/lib/elasticsearch/api/actions/indices/split.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/stats.rb +5 -2
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +4 -3
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +16 -9
- 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 +4 -4
- data/lib/elasticsearch/api/actions/msearch.rb +6 -5
- data/lib/elasticsearch/api/actions/msearch_template.rb +6 -5
- data/lib/elasticsearch/api/actions/mtermvectors.rb +16 -10
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -3
- data/lib/elasticsearch/api/actions/nodes/info.rb +4 -3
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +3 -3
- data/lib/elasticsearch/api/actions/nodes/stats.rb +7 -4
- data/lib/elasticsearch/api/actions/nodes/usage.rb +4 -3
- data/lib/elasticsearch/api/actions/ping.rb +2 -2
- data/lib/elasticsearch/api/actions/put_script.rb +3 -3
- data/lib/elasticsearch/api/actions/rank_eval.rb +6 -8
- data/lib/elasticsearch/api/actions/reindex.rb +2 -2
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +2 -2
- data/lib/elasticsearch/api/actions/render_search_template.rb +12 -7
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +9 -8
- data/lib/elasticsearch/api/actions/scroll.rb +12 -7
- data/lib/elasticsearch/api/actions/search.rb +18 -9
- data/lib/elasticsearch/api/actions/search_shards.rb +4 -3
- data/lib/elasticsearch/api/actions/search_template.rb +6 -4
- data/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +2 -2
- 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 -2
- data/lib/elasticsearch/api/actions/termvectors.rb +9 -4
- data/lib/elasticsearch/api/actions/update.rb +4 -3
- data/lib/elasticsearch/api/actions/update_by_query.rb +7 -3
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +2 -2
- 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/data_streams_stats_spec.rb +72 -0
- 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 +5 -6
- 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/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 +23 -42
- data/utils/thor/generator/endpoint_specifics.rb +8 -1
- data/utils/thor/templates/_documentation_top.erb +11 -2
- metadata +25 -11
- data/spec/README.md +0 -61
- data/test/integration/yaml_test_runner.rb +0 -592
- data/test/test_helper.rb +0 -118
@@ -26,14 +26,17 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false)
|
27
27
|
# @option arguments [String] :default_operator The default operator for query string query (AND or OR)
|
28
28
|
# (options: AND,OR)
|
29
|
+
|
29
30
|
# @option arguments [String] :df The field to use as default where no field prefix is given in the query string
|
30
31
|
# @option arguments [Number] :from Starting offset (default: 0)
|
31
32
|
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
32
33
|
# @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)
|
33
34
|
# @option arguments [String] :conflicts What to do when the delete by query hits version conflicts?
|
34
35
|
# (options: abort,proceed)
|
36
|
+
|
35
37
|
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
36
38
|
# (options: open,closed,hidden,none,all)
|
39
|
+
|
37
40
|
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
38
41
|
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
|
39
42
|
# @option arguments [String] :q Query in the Lucene query string syntax
|
@@ -41,6 +44,7 @@ module Elasticsearch
|
|
41
44
|
# @option arguments [Time] :scroll Specify how long a consistent view of the index should be maintained for scrolled search
|
42
45
|
# @option arguments [String] :search_type Search operation type
|
43
46
|
# (options: query_then_fetch,dfs_query_then_fetch)
|
47
|
+
|
44
48
|
# @option arguments [Time] :search_timeout Explicit timeout for each search request. Defaults to no timeout.
|
45
49
|
# @option arguments [Number] :size Deprecated, please use `max_docs` instead
|
46
50
|
# @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents)
|
@@ -67,7 +71,7 @@ module Elasticsearch
|
|
67
71
|
# Deprecated since version 7.0.0
|
68
72
|
#
|
69
73
|
#
|
70
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
74
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-delete-by-query.html
|
71
75
|
#
|
72
76
|
def delete_by_query(arguments = {})
|
73
77
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
@@ -86,7 +90,7 @@ module Elasticsearch
|
|
86
90
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_delete_by_query"
|
87
91
|
else
|
88
92
|
"#{Utils.__listify(_index)}/_delete_by_query"
|
89
|
-
|
93
|
+
end
|
90
94
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
91
95
|
|
92
96
|
body = arguments[:body]
|
@@ -132,5 +136,5 @@ module Elasticsearch
|
|
132
136
|
:slices
|
133
137
|
].freeze)
|
134
138
|
end
|
135
|
-
|
139
|
+
end
|
136
140
|
end
|
@@ -24,7 +24,7 @@ module Elasticsearch
|
|
24
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.x/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.x/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
|
@@ -34,6 +34,7 @@ module Elasticsearch
|
|
34
34
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
35
35
|
# @option arguments [String] :version_type Specific version type
|
36
36
|
# (options: internal,external,external_gte,force)
|
37
|
+
|
37
38
|
# @option arguments [Hash] :headers Custom HTTP headers
|
38
39
|
#
|
39
40
|
# *Deprecation notice*:
|
@@ -41,7 +42,7 @@ module Elasticsearch
|
|
41
42
|
# Deprecated since version 7.0.0
|
42
43
|
#
|
43
44
|
#
|
44
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
45
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html
|
45
46
|
#
|
46
47
|
def exists(arguments = {})
|
47
48
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -62,7 +63,7 @@ module Elasticsearch
|
|
62
63
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
|
63
64
|
else
|
64
65
|
"#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
|
65
|
-
|
66
|
+
end
|
66
67
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
67
68
|
|
68
69
|
body = nil
|
@@ -89,5 +90,5 @@ module Elasticsearch
|
|
89
90
|
:version_type
|
90
91
|
].freeze)
|
91
92
|
end
|
92
|
-
|
93
|
+
end
|
93
94
|
end
|
@@ -33,6 +33,7 @@ module Elasticsearch
|
|
33
33
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
34
34
|
# @option arguments [String] :version_type Specific version type
|
35
35
|
# (options: internal,external,external_gte,force)
|
36
|
+
|
36
37
|
# @option arguments [Hash] :headers Custom HTTP headers
|
37
38
|
#
|
38
39
|
# *Deprecation notice*:
|
@@ -40,7 +41,7 @@ module Elasticsearch
|
|
40
41
|
# Deprecated since version 7.0.0
|
41
42
|
#
|
42
43
|
#
|
43
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
44
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html
|
44
45
|
#
|
45
46
|
def exists_source(arguments = {})
|
46
47
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -61,7 +62,7 @@ module Elasticsearch
|
|
61
62
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_source"
|
62
63
|
else
|
63
64
|
"#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}"
|
64
|
-
|
65
|
+
end
|
65
66
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
66
67
|
|
67
68
|
body = nil
|
@@ -84,5 +85,5 @@ module Elasticsearch
|
|
84
85
|
:version_type
|
85
86
|
].freeze)
|
86
87
|
end
|
87
|
-
|
88
|
+
end
|
88
89
|
end
|
@@ -27,6 +27,7 @@ module Elasticsearch
|
|
27
27
|
# @option arguments [String] :analyzer The analyzer for the query string query
|
28
28
|
# @option arguments [String] :default_operator The default operator for query string query (AND or OR)
|
29
29
|
# (options: AND,OR)
|
30
|
+
|
30
31
|
# @option arguments [String] :df The default field for query string query (default: _all)
|
31
32
|
# @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
|
32
33
|
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
@@ -44,7 +45,7 @@ module Elasticsearch
|
|
44
45
|
# Deprecated since version 7.0.0
|
45
46
|
#
|
46
47
|
#
|
47
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
48
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-explain.html
|
48
49
|
#
|
49
50
|
def explain(arguments = {})
|
50
51
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -60,12 +61,17 @@ module Elasticsearch
|
|
60
61
|
|
61
62
|
_type = arguments.delete(:type)
|
62
63
|
|
63
|
-
method =
|
64
|
-
|
65
|
-
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_explain"
|
64
|
+
method = if arguments[:body]
|
65
|
+
Elasticsearch::API::HTTP_POST
|
66
66
|
else
|
67
|
-
|
68
|
-
|
67
|
+
Elasticsearch::API::HTTP_GET
|
68
|
+
end
|
69
|
+
|
70
|
+
path = if _index && _type && _id
|
71
|
+
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_explain"
|
72
|
+
else
|
73
|
+
"#{Utils.__listify(_index)}/_explain/#{Utils.__listify(_id)}"
|
74
|
+
end
|
69
75
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
70
76
|
|
71
77
|
body = arguments[:body]
|
@@ -90,5 +96,5 @@ module Elasticsearch
|
|
90
96
|
:_source_includes
|
91
97
|
].freeze)
|
92
98
|
end
|
93
|
-
|
99
|
+
end
|
94
100
|
end
|
@@ -26,10 +26,12 @@ module Elasticsearch
|
|
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
27
|
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
28
28
|
# (options: open,closed,hidden,none,all)
|
29
|
+
|
29
30
|
# @option arguments [Boolean] :include_unmapped Indicates whether unmapped fields should be included in the response.
|
30
31
|
# @option arguments [Hash] :headers Custom HTTP headers
|
32
|
+
# @option arguments [Hash] :body An index filter specified with the Query DSL
|
31
33
|
#
|
32
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
34
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-field-caps.html
|
33
35
|
#
|
34
36
|
def field_caps(arguments = {})
|
35
37
|
headers = arguments.delete(:headers) || {}
|
@@ -38,15 +40,20 @@ module Elasticsearch
|
|
38
40
|
|
39
41
|
_index = arguments.delete(:index)
|
40
42
|
|
41
|
-
method =
|
42
|
-
|
43
|
-
"#{Utils.__listify(_index)}/_field_caps"
|
43
|
+
method = if arguments[:body]
|
44
|
+
Elasticsearch::API::HTTP_POST
|
44
45
|
else
|
45
|
-
|
46
|
-
|
46
|
+
Elasticsearch::API::HTTP_GET
|
47
|
+
end
|
48
|
+
|
49
|
+
path = if _index
|
50
|
+
"#{Utils.__listify(_index)}/_field_caps"
|
51
|
+
else
|
52
|
+
"_field_caps"
|
53
|
+
end
|
47
54
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
48
55
|
|
49
|
-
body =
|
56
|
+
body = arguments[:body]
|
50
57
|
perform_request(method, path, params, body, headers).body
|
51
58
|
end
|
52
59
|
|
@@ -61,5 +68,5 @@ module Elasticsearch
|
|
61
68
|
:include_unmapped
|
62
69
|
].freeze)
|
63
70
|
end
|
64
|
-
|
71
|
+
end
|
65
72
|
end
|
@@ -34,6 +34,7 @@ module Elasticsearch
|
|
34
34
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
35
35
|
# @option arguments [String] :version_type Specific version type
|
36
36
|
# (options: internal,external,external_gte,force)
|
37
|
+
|
37
38
|
# @option arguments [Hash] :headers Custom HTTP headers
|
38
39
|
#
|
39
40
|
# *Deprecation notice*:
|
@@ -41,7 +42,7 @@ module Elasticsearch
|
|
41
42
|
# Deprecated since version 7.0.0
|
42
43
|
#
|
43
44
|
#
|
44
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
45
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html
|
45
46
|
#
|
46
47
|
def get(arguments = {})
|
47
48
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -62,7 +63,7 @@ module Elasticsearch
|
|
62
63
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
|
63
64
|
else
|
64
65
|
"#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
|
65
|
-
|
66
|
+
end
|
66
67
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
67
68
|
|
68
69
|
body = nil
|
@@ -89,5 +90,5 @@ module Elasticsearch
|
|
89
90
|
:version_type
|
90
91
|
].freeze)
|
91
92
|
end
|
92
|
-
|
93
|
+
end
|
93
94
|
end
|
@@ -24,7 +24,7 @@ module Elasticsearch
|
|
24
24
|
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
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.x/modules-scripting.html
|
28
28
|
#
|
29
29
|
def get_script(arguments = {})
|
30
30
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
@@ -50,5 +50,5 @@ module Elasticsearch
|
|
50
50
|
:master_timeout
|
51
51
|
].freeze)
|
52
52
|
end
|
53
|
-
|
53
|
+
end
|
54
54
|
end
|
@@ -19,14 +19,10 @@ module Elasticsearch
|
|
19
19
|
module API
|
20
20
|
module Actions
|
21
21
|
# Returns all script contexts.
|
22
|
-
# This functionality is Experimental and may be changed or removed
|
23
|
-
# completely in a future release. Elastic will take a best effort approach
|
24
|
-
# to fix any issues, but experimental features are not subject to the
|
25
|
-
# support SLA of official GA features.
|
26
22
|
#
|
27
23
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
24
|
#
|
29
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/painless/7.
|
25
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/painless/7.x/painless-contexts.html
|
30
26
|
#
|
31
27
|
def get_script_context(arguments = {})
|
32
28
|
headers = arguments.delete(:headers) || {}
|
@@ -41,5 +37,5 @@ module Elasticsearch
|
|
41
37
|
perform_request(method, path, params, body, headers).body
|
42
38
|
end
|
43
39
|
end
|
44
|
-
|
40
|
+
end
|
45
41
|
end
|
@@ -19,14 +19,10 @@ module Elasticsearch
|
|
19
19
|
module API
|
20
20
|
module Actions
|
21
21
|
# Returns available script types, languages and contexts
|
22
|
-
# This functionality is Experimental and may be changed or removed
|
23
|
-
# completely in a future release. Elastic will take a best effort approach
|
24
|
-
# to fix any issues, but experimental features are not subject to the
|
25
|
-
# support SLA of official GA features.
|
26
22
|
#
|
27
23
|
# @option arguments [Hash] :headers Custom HTTP headers
|
28
24
|
#
|
29
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
25
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-scripting.html
|
30
26
|
#
|
31
27
|
def get_script_languages(arguments = {})
|
32
28
|
headers = arguments.delete(:headers) || {}
|
@@ -41,5 +37,5 @@ module Elasticsearch
|
|
41
37
|
perform_request(method, path, params, body, headers).body
|
42
38
|
end
|
43
39
|
end
|
44
|
-
|
40
|
+
end
|
45
41
|
end
|
@@ -33,6 +33,7 @@ module Elasticsearch
|
|
33
33
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
34
34
|
# @option arguments [String] :version_type Specific version type
|
35
35
|
# (options: internal,external,external_gte,force)
|
36
|
+
|
36
37
|
# @option arguments [Hash] :headers Custom HTTP headers
|
37
38
|
#
|
38
39
|
# *Deprecation notice*:
|
@@ -40,7 +41,7 @@ module Elasticsearch
|
|
40
41
|
# Deprecated since version 7.0.0
|
41
42
|
#
|
42
43
|
#
|
43
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
44
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-get.html
|
44
45
|
#
|
45
46
|
def get_source(arguments = {})
|
46
47
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
@@ -61,7 +62,7 @@ module Elasticsearch
|
|
61
62
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_source"
|
62
63
|
else
|
63
64
|
"#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}"
|
64
|
-
|
65
|
+
end
|
65
66
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
66
67
|
|
67
68
|
body = nil
|
@@ -83,5 +84,5 @@ module Elasticsearch
|
|
83
84
|
:version_type
|
84
85
|
].freeze)
|
85
86
|
end
|
86
|
-
|
87
|
+
end
|
87
88
|
end
|
@@ -26,13 +26,16 @@ module Elasticsearch
|
|
26
26
|
# @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the index 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
27
|
# @option arguments [String] :op_type Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID
|
28
28
|
# (options: index,create)
|
29
|
+
|
29
30
|
# @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.
|
30
31
|
# (options: true,false,wait_for)
|
32
|
+
|
31
33
|
# @option arguments [String] :routing Specific routing value
|
32
34
|
# @option arguments [Time] :timeout Explicit operation timeout
|
33
35
|
# @option arguments [Number] :version Explicit version number for concurrency control
|
34
36
|
# @option arguments [String] :version_type Specific version type
|
35
37
|
# (options: internal,external,external_gte)
|
38
|
+
|
36
39
|
# @option arguments [Number] :if_seq_no only perform the index operation if the last operation that has changed the document has the specified sequence number
|
37
40
|
# @option arguments [Number] :if_primary_term only perform the index operation if the last operation that has changed the document has the specified primary term
|
38
41
|
# @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
|
@@ -44,7 +47,7 @@ module Elasticsearch
|
|
44
47
|
# Deprecated since version 7.0.0
|
45
48
|
#
|
46
49
|
#
|
47
|
-
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.
|
50
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/docs-index_.html
|
48
51
|
#
|
49
52
|
def index(arguments = {})
|
50
53
|
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
@@ -69,7 +72,7 @@ module Elasticsearch
|
|
69
72
|
"#{Utils.__listify(_index)}/#{Utils.__listify(_type)}"
|
70
73
|
else
|
71
74
|
"#{Utils.__listify(_index)}/_doc"
|
72
|
-
|
75
|
+
end
|
73
76
|
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
74
77
|
|
75
78
|
body = arguments[:body]
|
@@ -92,5 +95,5 @@ module Elasticsearch
|
|
92
95
|
:pipeline
|
93
96
|
].freeze)
|
94
97
|
end
|
95
|
-
|
98
|
+
end
|
96
99
|
end
|
@@ -0,0 +1,70 @@
|
|
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 Indices
|
21
|
+
module Actions
|
22
|
+
# Adds a block to an index.
|
23
|
+
#
|
24
|
+
# @option arguments [List] :index A comma separated list of indices to add a block to
|
25
|
+
# @option arguments [String] :block The block to add (one of read, write, read_only or metadata)
|
26
|
+
# @option arguments [Time] :timeout Explicit operation timeout
|
27
|
+
# @option arguments [Time] :master_timeout Specify timeout for connection to master
|
28
|
+
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
29
|
+
# @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)
|
30
|
+
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both.
|
31
|
+
# (options: open,closed,hidden,none,all)
|
32
|
+
|
33
|
+
# @option arguments [Hash] :headers Custom HTTP headers
|
34
|
+
#
|
35
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/indices-blocks.html
|
36
|
+
#
|
37
|
+
def add_block(arguments = {})
|
38
|
+
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
39
|
+
raise ArgumentError, "Required argument 'block' missing" unless arguments[:block]
|
40
|
+
|
41
|
+
headers = arguments.delete(:headers) || {}
|
42
|
+
|
43
|
+
arguments = arguments.clone
|
44
|
+
|
45
|
+
_index = arguments.delete(:index)
|
46
|
+
|
47
|
+
_block = arguments.delete(:block)
|
48
|
+
|
49
|
+
method = Elasticsearch::API::HTTP_PUT
|
50
|
+
path = "#{Utils.__listify(_index)}/_block/#{Utils.__listify(_block)}"
|
51
|
+
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
52
|
+
|
53
|
+
body = nil
|
54
|
+
perform_request(method, path, params, body, headers).body
|
55
|
+
end
|
56
|
+
|
57
|
+
# Register this action with its valid params when the module is loaded.
|
58
|
+
#
|
59
|
+
# @since 6.2.0
|
60
|
+
ParamsRegistry.register(:add_block, [
|
61
|
+
:timeout,
|
62
|
+
:master_timeout,
|
63
|
+
:ignore_unavailable,
|
64
|
+
:allow_no_indices,
|
65
|
+
:expand_wildcards
|
66
|
+
].freeze)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|