elasticsearch-api 6.2.0 → 6.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -1
  3. data/lib/elasticsearch/api/actions/benchmark.rb +1 -1
  4. data/lib/elasticsearch/api/actions/bulk.rb +4 -6
  5. data/lib/elasticsearch/api/actions/cat/aliases.rb +10 -10
  6. data/lib/elasticsearch/api/actions/cat/allocation.rb +11 -11
  7. data/lib/elasticsearch/api/actions/cat/count.rb +10 -10
  8. data/lib/elasticsearch/api/actions/cat/fielddata.rb +9 -7
  9. data/lib/elasticsearch/api/actions/cat/health.rb +11 -11
  10. data/lib/elasticsearch/api/actions/cat/help.rb +4 -2
  11. data/lib/elasticsearch/api/actions/cat/indices.rb +14 -15
  12. data/lib/elasticsearch/api/actions/cat/master.rb +10 -10
  13. data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +6 -4
  14. data/lib/elasticsearch/api/actions/cat/nodes.rb +10 -10
  15. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +10 -10
  16. data/lib/elasticsearch/api/actions/cat/plugins.rb +7 -6
  17. data/lib/elasticsearch/api/actions/cat/recovery.rb +10 -12
  18. data/lib/elasticsearch/api/actions/cat/repositories.rb +7 -3
  19. data/lib/elasticsearch/api/actions/cat/segments.rb +9 -7
  20. data/lib/elasticsearch/api/actions/cat/shards.rb +12 -12
  21. data/lib/elasticsearch/api/actions/cat/snapshots.rb +8 -4
  22. data/lib/elasticsearch/api/actions/cat/tasks.rb +4 -6
  23. data/lib/elasticsearch/api/actions/cat/templates.rb +6 -6
  24. data/lib/elasticsearch/api/actions/cat/thread_pool.rb +13 -17
  25. data/lib/elasticsearch/api/actions/clear_scroll.rb +7 -0
  26. data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +2 -3
  27. data/lib/elasticsearch/api/actions/cluster/get_settings.rb +5 -2
  28. data/lib/elasticsearch/api/actions/cluster/health.rb +11 -20
  29. data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +2 -3
  30. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +8 -3
  31. data/lib/elasticsearch/api/actions/cluster/remote_info.rb +7 -1
  32. data/lib/elasticsearch/api/actions/cluster/reroute.rb +7 -7
  33. data/lib/elasticsearch/api/actions/cluster/state.rb +18 -15
  34. data/lib/elasticsearch/api/actions/cluster/stats.rb +12 -5
  35. data/lib/elasticsearch/api/actions/count.rb +12 -23
  36. data/lib/elasticsearch/api/actions/count_percolate.rb +1 -1
  37. data/lib/elasticsearch/api/actions/delete.rb +16 -8
  38. data/lib/elasticsearch/api/actions/delete_by_query.rb +7 -9
  39. data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +29 -0
  40. data/lib/elasticsearch/api/actions/delete_script.rb +5 -6
  41. data/lib/elasticsearch/api/actions/exists.rb +3 -4
  42. data/lib/elasticsearch/api/actions/exists_source.rb +51 -0
  43. data/lib/elasticsearch/api/actions/explain.rb +11 -25
  44. data/lib/elasticsearch/api/actions/field_caps.rb +2 -2
  45. data/lib/elasticsearch/api/actions/get.rb +13 -19
  46. data/lib/elasticsearch/api/actions/get_script.rb +9 -2
  47. data/lib/elasticsearch/api/actions/get_source.rb +10 -14
  48. data/lib/elasticsearch/api/actions/index.rb +10 -16
  49. data/lib/elasticsearch/api/actions/indices/analyze.rb +3 -27
  50. data/lib/elasticsearch/api/actions/indices/clear_cache.rb +2 -4
  51. data/lib/elasticsearch/api/actions/indices/close.rb +9 -15
  52. data/lib/elasticsearch/api/actions/indices/create.rb +7 -7
  53. data/lib/elasticsearch/api/actions/indices/delete.rb +3 -4
  54. data/lib/elasticsearch/api/actions/indices/delete_alias.rb +7 -4
  55. data/lib/elasticsearch/api/actions/indices/delete_template.rb +5 -2
  56. data/lib/elasticsearch/api/actions/indices/exists.rb +11 -17
  57. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +6 -14
  58. data/lib/elasticsearch/api/actions/indices/exists_template.rb +8 -4
  59. data/lib/elasticsearch/api/actions/indices/exists_type.rb +6 -15
  60. data/lib/elasticsearch/api/actions/indices/flush.rb +5 -9
  61. data/lib/elasticsearch/api/actions/indices/flush_synced.rb +1 -1
  62. data/lib/elasticsearch/api/actions/indices/forcemerge.rb +13 -11
  63. data/lib/elasticsearch/api/actions/indices/freeze.rb +0 -1
  64. data/lib/elasticsearch/api/actions/indices/get.rb +9 -15
  65. data/lib/elasticsearch/api/actions/indices/get_alias.rb +6 -14
  66. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +11 -15
  67. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +12 -16
  68. data/lib/elasticsearch/api/actions/indices/get_settings.rb +12 -21
  69. data/lib/elasticsearch/api/actions/indices/get_template.rb +8 -5
  70. data/lib/elasticsearch/api/actions/indices/open.rb +9 -15
  71. data/lib/elasticsearch/api/actions/indices/put_alias.rb +6 -3
  72. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +11 -23
  73. data/lib/elasticsearch/api/actions/indices/put_settings.rb +10 -20
  74. data/lib/elasticsearch/api/actions/indices/put_template.rb +10 -5
  75. data/lib/elasticsearch/api/actions/indices/recovery.rb +2 -4
  76. data/lib/elasticsearch/api/actions/indices/refresh.rb +6 -14
  77. data/lib/elasticsearch/api/actions/indices/rollover.rb +6 -5
  78. data/lib/elasticsearch/api/actions/indices/segments.rb +6 -14
  79. data/lib/elasticsearch/api/actions/indices/shard_stores.rb +2 -4
  80. data/lib/elasticsearch/api/actions/indices/shrink.rb +6 -7
  81. data/lib/elasticsearch/api/actions/indices/split.rb +2 -1
  82. data/lib/elasticsearch/api/actions/indices/update_aliases.rb +7 -4
  83. data/lib/elasticsearch/api/actions/indices/upgrade.rb +10 -13
  84. data/lib/elasticsearch/api/actions/indices/validate_query.rb +14 -25
  85. data/lib/elasticsearch/api/actions/info.rb +6 -0
  86. data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +1 -1
  87. data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +4 -3
  88. data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +29 -0
  89. data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +1 -1
  90. data/lib/elasticsearch/api/actions/ingest/simulate.rb +5 -5
  91. data/lib/elasticsearch/api/actions/mget.rb +8 -17
  92. data/lib/elasticsearch/api/actions/msearch.rb +7 -2
  93. data/lib/elasticsearch/api/actions/msearch_template.rb +8 -1
  94. data/lib/elasticsearch/api/actions/mtermvectors.rb +21 -22
  95. data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -6
  96. data/lib/elasticsearch/api/actions/nodes/info.rb +6 -26
  97. data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +10 -4
  98. data/lib/elasticsearch/api/actions/nodes/stats.rb +11 -30
  99. data/lib/elasticsearch/api/actions/nodes/usage.rb +31 -0
  100. data/lib/elasticsearch/api/actions/ping.rb +6 -0
  101. data/lib/elasticsearch/api/actions/put_script.rb +10 -9
  102. data/lib/elasticsearch/api/actions/rank_eval.rb +36 -0
  103. data/lib/elasticsearch/api/actions/reindex.rb +9 -14
  104. data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +29 -0
  105. data/lib/elasticsearch/api/actions/render_search_template.rb +1 -1
  106. data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +27 -0
  107. data/lib/elasticsearch/api/actions/scroll.rb +3 -2
  108. data/lib/elasticsearch/api/actions/search.rb +36 -53
  109. data/lib/elasticsearch/api/actions/search_shards.rb +7 -14
  110. data/lib/elasticsearch/api/actions/search_template.rb +20 -19
  111. data/lib/elasticsearch/api/actions/snapshot/create.rb +2 -3
  112. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +4 -3
  113. data/lib/elasticsearch/api/actions/snapshot/delete.rb +3 -3
  114. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +1 -2
  115. data/lib/elasticsearch/api/actions/snapshot/get.rb +3 -3
  116. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +3 -6
  117. data/lib/elasticsearch/api/actions/snapshot/restore.rb +1 -1
  118. data/lib/elasticsearch/api/actions/snapshot/status.rb +4 -5
  119. data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +1 -2
  120. data/lib/elasticsearch/api/actions/tasks/cancel.rb +7 -13
  121. data/lib/elasticsearch/api/actions/tasks/get.rb +6 -3
  122. data/lib/elasticsearch/api/actions/tasks/list.rb +10 -16
  123. data/lib/elasticsearch/api/actions/termvectors.rb +22 -21
  124. data/lib/elasticsearch/api/actions/update.rb +19 -33
  125. data/lib/elasticsearch/api/actions/update_by_query.rb +13 -33
  126. data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +29 -0
  127. data/lib/elasticsearch/api/version.rb +1 -1
  128. data/spec/elasticsearch/api/actions/cluster/state_spec.rb +0 -17
  129. data/spec/elasticsearch/api/actions/cluster/stats_spec.rb +17 -0
  130. data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +0 -37
  131. data/spec/elasticsearch/api/actions/indices/put_settings_spec.rb +0 -15
  132. data/spec/elasticsearch/api/actions/indices/refresh_spec.rb +0 -15
  133. data/spec/elasticsearch/api/actions/indices/segments_spec.rb +0 -15
  134. data/spec/elasticsearch/api/actions/mget_spec.rb +0 -15
  135. data/spec/elasticsearch/api/actions/mlt_spec.rb +127 -114
  136. data/spec/elasticsearch/api/actions/search_exists_spec.rb +58 -12
  137. data/spec/elasticsearch/api/actions/search_spec.rb +0 -15
  138. data/test/integration/yaml_test_runner.rb +2 -4
  139. data/utils/thor/generate_source.rb +1 -0
  140. data/utils/thor/templates/ruby/method.erb +7 -5
  141. metadata +12 -10
  142. data/spec/elasticsearch/api/actions/indices/freeze_spec.rb +0 -68
  143. data/spec/elasticsearch/api/actions/indices/stats_spec.rb +0 -108
  144. data/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +0 -68
@@ -10,7 +10,7 @@ module Elasticsearch
10
10
  # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
11
11
  # @option arguments [Time] :timeout Explicit operation timeout
12
12
  #
13
- # @see https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html
13
+ # @see https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html
14
14
  #
15
15
  def put_pipeline(arguments={})
16
16
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -6,11 +6,10 @@ module Elasticsearch
6
6
  # Execute a specific pipeline against the set of documents provided in the body of the request
7
7
  #
8
8
  # @option arguments [String] :id Pipeline ID
9
- # @option arguments [Hash] :body The pipeline definition (*Required*)
10
- # @option arguments [Boolean] :verbose Verbose mode. Display data output for each processor
11
- # in executed pipeline
9
+ # @option arguments [Hash] :body The simulate definition (*Required*)
10
+ # @option arguments [Boolean] :verbose Verbose mode. Display data output for each processor in executed pipeline
12
11
  #
13
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html
12
+ # @see https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html
14
13
  #
15
14
  def simulate(arguments={})
16
15
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
@@ -25,7 +24,8 @@ module Elasticsearch
25
24
  # Register this action with its valid params when the module is loaded.
26
25
  #
27
26
  # @since 6.2.0
28
- ParamsRegistry.register(:simulate, [ :verbose ].freeze)
27
+ ParamsRegistry.register(:simulate, [
28
+ :verbose ].freeze)
29
29
  end
30
30
  end
31
31
  end
@@ -27,20 +27,15 @@ module Elasticsearch
27
27
  #
28
28
  # @option arguments [String] :index The name of the index
29
29
  # @option arguments [String] :type The type of the document
30
- # @option arguments [Hash] :body Document identifiers; can be either `docs` (containing full document information)
31
- # or `ids` (when index and type is provided in the URL (*Required*)
32
- # @option arguments [List] :fields A comma-separated list of fields to return in the response
33
- # @option arguments [String] :parent The ID of the parent document
34
- # @option arguments [String] :preference Specify the node or shard the operation should be performed on
35
- # (default: random)
30
+ # @option arguments [Hash] :body Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. (*Required*)
31
+ # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
32
+ # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
36
33
  # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
37
34
  # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation
38
35
  # @option arguments [String] :routing Specific routing value
39
- # @option arguments [String] :_source Specify whether the _source field should be returned,
40
- # or a list of fields to return
41
- # @option arguments [String] :_source_exclude A list of fields to exclude from the returned _source field
42
- # @option arguments [String] :_source_include A list of fields to extract and return from the _source field
43
- # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
36
+ # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
37
+ # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
38
+ # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
44
39
  #
45
40
  # @see http://elasticsearch.org/guide/reference/api/multi-get/
46
41
  #
@@ -63,18 +58,14 @@ module Elasticsearch
63
58
  #
64
59
  # @since 6.2.0
65
60
  ParamsRegistry.register(:mget, [
66
- :fields,
67
- :parent,
61
+ :stored_fields,
68
62
  :preference,
69
63
  :realtime,
70
64
  :refresh,
71
65
  :routing,
72
66
  :_source,
73
- :_source_include,
74
- :_source_includes,
75
- :_source_exclude,
76
67
  :_source_excludes,
77
- :stored_fields ].freeze)
68
+ :_source_includes ].freeze)
78
69
  end
79
70
  end
80
71
  end
@@ -28,10 +28,13 @@ module Elasticsearch
28
28
  #
29
29
  # @option arguments [List] :index A comma-separated list of index names to use as default
30
30
  # @option arguments [List] :type A comma-separated list of document types to use as default
31
- # @option arguments [Hash] :body The request definitions (metadata-search request definition pairs)
31
+ # @option arguments [Hash] :body The request definitions (metadata-search request definition pairs), separated by newlines (*Required*)
32
32
  # @option arguments [String] :search_type Search operation type (options: query_then_fetch, query_and_fetch, dfs_query_then_fetch, dfs_query_and_fetch)
33
33
  # @option arguments [Number] :max_concurrent_searches Controls the maximum number of concurrent searches the multi search api will execute
34
34
  # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response
35
+ # @option arguments [Number] :pre_filter_shard_size A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
36
+ # @option arguments [Number] :max_concurrent_shard_requests The number of concurrent shard requests each sub search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
37
+ # @option arguments [Boolean] :rest_total_hits_as_int This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number
35
38
  #
36
39
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-multi-search.html
37
40
  #
@@ -68,14 +71,16 @@ module Elasticsearch
68
71
  perform_request(method, path, params, payload, {"Content-Type" => "application/x-ndjson"}).body
69
72
  end
70
73
 
74
+
71
75
  # Register this action with its valid params when the module is loaded.
72
76
  #
73
77
  # @since 6.2.0
74
78
  ParamsRegistry.register(:msearch, [
75
79
  :search_type,
76
80
  :max_concurrent_searches,
77
- :max_concurrent_shard_requests,
78
81
  :typed_keys,
82
+ :pre_filter_shard_size,
83
+ :max_concurrent_shard_requests,
79
84
  :rest_total_hits_as_int ].freeze)
80
85
  end
81
86
  end
@@ -15,6 +15,9 @@ module Elasticsearch
15
15
  # @option arguments [List] :type A comma-separated list of document types to use as default
16
16
  # @option arguments [Hash] :body The request definitions (metadata-search request definition pairs), separated by newlines (*Required*)
17
17
  # @option arguments [String] :search_type Search operation type (options: query_then_fetch, query_and_fetch, dfs_query_then_fetch, dfs_query_and_fetch)
18
+ # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response
19
+ # @option arguments [Number] :max_concurrent_searches Controls the maximum number of concurrent searches the multi search api will execute
20
+ # @option arguments [Boolean] :rest_total_hits_as_int This parameter is ignored in this version. It is used in the next major version to control whether the rest response should render the total.hits as an object or a number
18
21
  #
19
22
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-search-template.html
20
23
  #
@@ -42,7 +45,11 @@ module Elasticsearch
42
45
  # Register this action with its valid params when the module is loaded.
43
46
  #
44
47
  # @since 6.2.0
45
- ParamsRegistry.register(:msearch_template, [ :search_type ].freeze)
48
+ ParamsRegistry.register(:msearch_template, [
49
+ :search_type,
50
+ :typed_keys,
51
+ :max_concurrent_searches,
52
+ :rest_total_hits_as_int ].freeze)
46
53
  end
47
54
  end
48
55
  end
@@ -9,27 +9,24 @@ module Elasticsearch
9
9
  #
10
10
  # subject.mtermvectors index: 'my-index', type: 'my-type', body: { ids: [1, 2, 3] }
11
11
  #
12
- # @option arguments [String] :index The name of the index
13
- # @option arguments [String] :type The type of the document
14
- # @option arguments [Hash] :body Document identifiers; can be either `docs` (containing full document information)
15
- # or `ids` (when index and type is provided in the URL (*Required*)
16
- # @option arguments [List] :ids A comma-separated list of documents ids (alternative to `:body`)
17
- # @option arguments [Boolean] :term_statistics Whether total term frequency and
18
- # document frequency should be returned.
19
- # @option arguments [Boolean] :field_statistics Whether document count, sum of document frequencies
20
- # and sum of total term frequencies should be returned.
21
- # @option arguments [List] :fields A comma-separated list of fields to return
22
- # @option arguments [Boolean] :offsets Whether term offsets should be returned
23
- # @option arguments [Boolean] :positions Whether term positions should be returned
24
- # @option arguments [Boolean] :payloads Whether term payloads should be returned
25
- # @option arguments [String] :preference Specify the node or shard the operation should be performed on
26
- # (default: random)
27
- # @option arguments [String] :realtime Specifies if requests are real-time as opposed to near-real-time
28
- # (default: true)
29
- # @option arguments [String] :routing Specific routing value
30
- # @option arguments [String] :parent Parent ID of documents
12
+ # @option arguments [String] :index The index in which the document resides.
13
+ # @option arguments [String] :type The type of the document.
14
+ # @option arguments [Hash] :body Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation.
15
+ # @option arguments [List] :ids A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
16
+ # @option arguments [Boolean] :term_statistics Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
17
+ # @option arguments [Boolean] :field_statistics Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
18
+ # @option arguments [List] :fields A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs".
19
+ # @option arguments [Boolean] :offsets Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
20
+ # @option arguments [Boolean] :positions Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
21
+ # @option arguments [Boolean] :payloads Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
22
+ # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs".
23
+ # @option arguments [String] :routing Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs".
24
+ # @option arguments [String] :parent Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs".
25
+ # @option arguments [Boolean] :realtime Specifies if requests are real-time as opposed to near-real-time (default: true).
26
+ # @option arguments [Number] :version Explicit version number for concurrency control
27
+ # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
31
28
  #
32
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html
29
+ # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html
33
30
  #
34
31
  # @see #mget
35
32
  # @see #termvector
@@ -65,9 +62,11 @@ module Elasticsearch
65
62
  :positions,
66
63
  :payloads,
67
64
  :preference,
68
- :realtime,
69
65
  :routing,
70
- :parent ].freeze)
66
+ :parent,
67
+ :realtime,
68
+ :version,
69
+ :version_type ].freeze)
71
70
  end
72
71
  end
73
72
  end
@@ -13,18 +13,15 @@ module Elasticsearch
13
13
  #
14
14
  # client.nodes.hot_threads threads: 10
15
15
  #
16
- # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information;
17
- # use `_local` to return information from the node you're connecting to,
18
- # leave empty to get information from all nodes
16
+ # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
19
17
  # @option arguments [Time] :interval The interval for the second sampling of threads
20
18
  # @option arguments [Number] :snapshots Number of samples of thread stacktrace (default: 10)
21
19
  # @option arguments [Number] :threads Specify the number of threads to provide information for (default: 3)
20
+ # @option arguments [Boolean] :ignore_idle_threads Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)
22
21
  # @option arguments [String] :type The type to sample (default: cpu) (options: cpu, wait, block)
23
22
  # @option arguments [Time] :timeout Explicit operation timeout
24
23
  #
25
- # @return [String]
26
- #
27
- # @see http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-hot-threads/
24
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html
28
25
  #
29
26
  def hot_threads(arguments={})
30
27
  method = HTTP_GET
@@ -43,6 +40,7 @@ module Elasticsearch
43
40
  :interval,
44
41
  :snapshots,
45
42
  :threads,
43
+ :ignore_idle_threads,
46
44
  :type,
47
45
  :timeout ].freeze)
48
46
  end
@@ -22,23 +22,12 @@ module Elasticsearch
22
22
  #
23
23
  # client.nodes.info metric: ['http', 'network']
24
24
  #
25
- # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information;
26
- # use `_local` to return information from the node you're connecting to, leave
27
- # empty to get information from all nodes
28
- # @option arguments [Boolean] :_all Return all available information
29
- # @option arguments [Boolean] :http Return information about HTTP
30
- # @option arguments [Boolean] :jvm Return information about the JVM
31
- # @option arguments [Boolean] :network Return information about network
32
- # @option arguments [Boolean] :os Return information about the operating system
33
- # @option arguments [Boolean] :plugins Return information about plugins
34
- # @option arguments [Boolean] :process Return information about the Elasticsearch process
35
- # @option arguments [Boolean] :settings Return information about node settings
36
- # @option arguments [Boolean] :thread_pool Return information about the thread pool
37
- # @option arguments [Boolean] :transport Return information about transport
25
+ # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
26
+ # @option arguments [List] :metric A comma-separated list of metrics you wish returned. Leave empty to return all. (options: settings,os,process,jvm,thread_pool,transport,http,plugins,ingest)
38
27
  # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
39
28
  # @option arguments [Time] :timeout Explicit operation timeout
40
29
  #
41
- # @see http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-info/
30
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html
42
31
  #
43
32
  def info(arguments={})
44
33
  arguments = arguments.clone
@@ -63,20 +52,11 @@ module Elasticsearch
63
52
  # @since 6.2.0
64
53
  ParamsRegistry.register(:info_params, [ :flat_settings, :timeout ].freeze)
65
54
 
66
- # Register this action with its valid parts when the module is loaded.
55
+ # Register this action with its valid params when the module is loaded.
67
56
  #
68
57
  # @since 6.2.0
69
- ParamsRegistry.register(:info_parts, [
70
- :_all,
71
- :http,
72
- :jvm,
73
- :network,
74
- :os,
75
- :plugins,
76
- :process,
77
- :settings,
78
- :thread_pool,
79
- :transport,
58
+ ParamsRegistry.register(:info, [
59
+ :flat_settings,
80
60
  :timeout ].freeze)
81
61
  end
82
62
  end
@@ -14,10 +14,10 @@ module Elasticsearch
14
14
  #
15
15
  # client.nodes.reload_secure_settings(node_id: 'foo,bar')
16
16
  #
17
- # @option arguments [ Array ] :node_id A comma-separated list of node IDs or names to perform the operation on
18
- # @option arguments [ String ] :timeout Explicit operation timeout
17
+ # @option arguments [List] :node_id A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
18
+ # @option arguments [Time] :timeout Explicit operation timeout
19
19
  #
20
- # @see http://elasticsearch.org/guide/reference/api/cluster-nodes-reload-secure-settings
20
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/6.x/secure-settings.html#reloadable-secure-settings
21
21
  #
22
22
  def reload_secure_settings(arguments={})
23
23
  valid_params = [
@@ -31,7 +31,13 @@ module Elasticsearch
31
31
 
32
32
  perform_request(method, path, params, body).body
33
33
  end
34
+
35
+ # Register this action with its valid params when the module is loaded.
36
+ #
37
+ # @since 6.2.0
38
+ ParamsRegistry.register(:reload_secure_settings, [
39
+ :timeout ].freeze)
34
40
  end
35
41
  end
36
42
  end
37
- end
43
+ end
@@ -13,34 +13,19 @@ module Elasticsearch
13
13
  #
14
14
  # client.nodes.stats metric: 'indices', index_metric: 'fielddata', fields: '*', human: true
15
15
  #
16
- # @option arguments [List] :metric Limit the information returned to the specified metrics
17
- # (options: _all, breaker, fs, http, indices, jvm, network,
18
- # os, process, thread_pool, transport)
19
- # @option arguments [List] :index_metric Limit the information returned for the `indices` metric
20
- # to the specified index metrics. Used only when
21
- # `indices` or `all` metric is specified.
22
- # (options: _all, completion, docs, fielddata, filter_cache, flush, get,
23
- # id_cache, indexing, merge, percolate, refresh, search, segments, store,
24
- # warmer)
25
- # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit
26
- # the returned information; use `_local` to return information
27
- # from the node you're connecting to, leave empty to get information
28
- # from all nodes
29
- # @option arguments [List] :completion_fields A comma-separated list of fields for `fielddata` and `suggest`
30
- # index metrics (supports wildcards)
31
- # @option arguments [List] :fielddata_fields A comma-separated list of fields for `fielddata` index metric
32
- # (supports wildcards)
33
- # @option arguments [List] :fields A comma-separated list of fields for `fielddata` and `completion` index
34
- # metrics (supports wildcards)
35
- # @option arguments [Boolean] :include_segment_file_sizes Whether to report the aggregated disk usage of each one of the Lucene index files. Only applies if segment stats are requested. (default: false)
16
+ # @option arguments [List] :metric Limit the information returned to the specified metrics (options: _all,breaker,fs,http,indices,jvm,os,process,thread_pool,transport,discovery)
17
+ # @option arguments [List] :index_metric Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. (options: _all,completion,docs,fielddata,query_cache,flush,get,indexing,merge,request_cache,refresh,search,segments,store,warmer,suggest)
18
+ # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
19
+ # @option arguments [List] :completion_fields A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
20
+ # @option arguments [List] :fielddata_fields A comma-separated list of fields for `fielddata` index metric (supports wildcards)
21
+ # @option arguments [List] :fields A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
36
22
  # @option arguments [Boolean] :groups A comma-separated list of search groups for `search` index metric
37
- # @option arguments [Boolean] :human Whether to return time and byte values in human-readable format
38
- # @option arguments [String] :level Specify the level for aggregating indices stats
39
- # (options: node, indices, shards)
23
+ # @option arguments [String] :level Return indices stats aggregated at index, node or shard level (options: indices, node, shards)
40
24
  # @option arguments [List] :types A comma-separated list of document types for the `indexing` index metric
41
25
  # @option arguments [Time] :timeout Explicit operation timeout
26
+ # @option arguments [Boolean] :include_segment_file_sizes Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
42
27
  #
43
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html
28
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html
44
29
  #
45
30
  def stats(arguments={})
46
31
  arguments = arguments.clone
@@ -67,18 +52,14 @@ module Elasticsearch
67
52
  #
68
53
  # @since 6.2.0
69
54
  ParamsRegistry.register(:stats, [
70
- :metric,
71
- :index_metric,
72
- :node_id,
73
55
  :completion_fields,
74
56
  :fielddata_fields,
75
57
  :fields,
76
- :include_segment_file_sizes,
77
58
  :groups,
78
- :human,
79
59
  :level,
80
60
  :types,
81
- :timeout ].freeze)
61
+ :timeout,
62
+ :include_segment_file_sizes ].freeze)
82
63
  end
83
64
  end
84
65
  end
@@ -0,0 +1,31 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Nodes
4
+ module Actions
5
+
6
+ # The cluster nodes usage API allows to retrieve information on the usage of features for each node.
7
+ #
8
+ # @option arguments [List] :metric Limit the information returned to the specified metrics (options: _all,rest_actions)
9
+ # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
10
+ # @option arguments [Time] :timeout Explicit operation timeout
11
+ #
12
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-usage.html
13
+ #
14
+ def usage(arguments={})
15
+ method = Elasticsearch::API::HTTP_GET
16
+ path = "_nodes/usage"
17
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
18
+ body = nil
19
+
20
+ perform_request(method, path, params, body).body
21
+ end
22
+
23
+ # Register this action with its valid params when the module is loaded.
24
+ #
25
+ # @since 6.2.0
26
+ ParamsRegistry.register(:usage, [
27
+ :timeout ].freeze)
28
+ end
29
+ end
30
+ end
31
+ end
@@ -26,6 +26,12 @@ module Elasticsearch
26
26
  end
27
27
  end
28
28
  end
29
+
30
+ # Register this action with its valid params when the module is loaded.
31
+ #
32
+ # @since 6.2.0
33
+ ParamsRegistry.register(:ping, [
34
+ ].freeze)
29
35
  end
30
36
  end
31
37
  end
@@ -19,13 +19,13 @@ module Elasticsearch
19
19
  # }
20
20
  #
21
21
  # @option arguments [String] :id Script ID (*Required*)
22
- # @option arguments [String] :lang Script language
23
- # @option arguments [Hash] :body A JSON document containing the script (*Required*)
24
- # @option arguments [Number] :version Explicit version number for concurrency control
25
- # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
26
- # @option arguments [String] :op_type Explicit operation type (options: index, create)
22
+ # @option arguments [String] :context Script context
23
+ # @option arguments [Hash] :body The document (*Required*)
24
+ # @option arguments [Time] :timeout Explicit operation timeout
25
+ # @option arguments [Time] :master_timeout Specify timeout for connection to master
26
+ # @option arguments [String] :context Context name to compile script against
27
27
  #
28
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html#_indexed_scripts
28
+ # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html#_indexed_scripts
29
29
  #
30
30
  def put_script(arguments={})
31
31
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -40,13 +40,14 @@ module Elasticsearch
40
40
  perform_request(method, path, params, body).body
41
41
  end
42
42
 
43
+
43
44
  # Register this action with its valid params when the module is loaded.
44
45
  #
45
46
  # @since 6.2.0
46
47
  ParamsRegistry.register(:put_script, [
47
- :op_type,
48
- :version,
49
- :version_type ].freeze)
48
+ :timeout,
49
+ :master_timeout,
50
+ :context ].freeze)
50
51
  end
51
52
  end
52
53
  end
@@ -0,0 +1,36 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Actions
4
+
5
+ # The ranking evaluation API allows to evaluate the quality of ranked search results over a set of typical search queries.
6
+ # Given this set of queries and a list of manually rated documents, the _rank_eval endpoint calculates and
7
+ # returns typical information retrieval metrics like mean reciprocal rank, precision or discounted cumulative gain.
8
+ #
9
+ # @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
10
+ # @option arguments [Hash] :body The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. (*Required*)
11
+ # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
12
+ # @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)
13
+ # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, none, all)
14
+ #
15
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-rank-eval.html
16
+ #
17
+ def rank_eval(arguments={})
18
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
19
+ method = Elasticsearch::API::HTTP_GET
20
+ path = "_rank_eval"
21
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
22
+ body = arguments[:body]
23
+
24
+ perform_request(method, path, params, body).body
25
+ end
26
+
27
+ # Register this action with its valid params when the module is loaded.
28
+ #
29
+ # @since 6.2.0
30
+ ParamsRegistry.register(:rank_eval, [
31
+ :ignore_unavailable,
32
+ :allow_no_indices,
33
+ :expand_wildcards ].freeze)
34
+ end
35
+ end
36
+ end
@@ -35,19 +35,14 @@ module Elasticsearch
35
35
  # }
36
36
  # }
37
37
  #
38
- # @option arguments [Hash] :body The definition of the operation (source index, target index, ...)
39
- # (*Required*)
40
- # @option arguments [Boolean] :refresh Whether the affected indexes should be refreshed
41
- # @option arguments [Time] :timeout Time each individual bulk request should wait for shards
42
- # that are unavailable. (Default: 1m)
43
- # @option arguments [String] :consistency Explicit write consistency setting for the operation
44
- # (Options: one, quorum, all)
45
- # @option arguments [Boolean] :wait_for_completion Whether the request should block and wait until
46
- # the operation has completed
47
- # @option arguments [Float] :requests_per_second The throttling for this request in sub-requests per second.
48
- # 0 means set no throttling (default)
49
- # @option arguments [Integer] :slices The number of slices this request should be divided into.
50
- # Defaults to 1 meaning the request isn't sliced into sub-requests.
38
+ # @option arguments [Hash] :body The search definition using the Query DSL and the prototype for the index request. (*Required*)
39
+ # @option arguments [Boolean] :refresh Should the effected indexes be refreshed?
40
+ # @option arguments [Time] :timeout Time each individual bulk request should wait for shards that are unavailable.
41
+ # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the reindex 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)
42
+ # @option arguments [Boolean] :wait_for_completion Should the request should block until the reindex is complete.
43
+ # @option arguments [Number] :requests_per_second The throttle to set on this request in sub-requests per second. -1 means no throttle.
44
+ # @option arguments [Number] :slices The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks.
45
+ #
51
46
  #
52
47
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html
53
48
  #
@@ -67,7 +62,7 @@ module Elasticsearch
67
62
  ParamsRegistry.register(:reindex, [
68
63
  :refresh,
69
64
  :timeout,
70
- :consistency,
65
+ :wait_for_active_shards,
71
66
  :wait_for_completion,
72
67
  :requests_per_second,
73
68
  :slices ].freeze)
@@ -0,0 +1,29 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Actions
4
+
5
+ # The value of requests_per_second can be changed on a running reindex using the _rethrottle
6
+ #
7
+ # @option arguments [String] :task_id The task id to rethrottle (*Required*)
8
+ # @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
9
+ #
10
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html
11
+ #
12
+ def reindex_rethrottle(arguments={})
13
+ raise ArgumentError, "Required argument 'task_id' missing" unless arguments[:task_id]
14
+ method = Elasticsearch::API::HTTP_POST
15
+ path = "_reindex/#{arguments[:task_id]}/_rethrottle"
16
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
17
+ body = nil
18
+
19
+ perform_request(method, path, params, body).body
20
+ end
21
+
22
+ # Register this action with its valid params when the module is loaded.
23
+ #
24
+ # @since 6.2.0
25
+ ParamsRegistry.register(:reindex_rethrottle, [
26
+ :requests_per_second ].freeze)
27
+ end
28
+ end
29
+ end
@@ -7,7 +7,7 @@ module Elasticsearch
7
7
  # @option arguments [String] :id The id of the stored search template
8
8
  # @option arguments [Hash] :body The search definition template and its params
9
9
  #
10
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html
10
+ # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html
11
11
  #
12
12
  def render_search_template(arguments={})
13
13
  method = 'GET'
@@ -0,0 +1,27 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Actions
4
+
5
+ # The Painless execute API allows an arbitrary script to be executed and a result to be returned.
6
+ #
7
+ # @option arguments [Hash] :body The script to execute
8
+ #
9
+ # @see https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-execute-api.html
10
+ #
11
+ def scripts_painless_execute(arguments={})
12
+ method = Elasticsearch::API::HTTP_GET
13
+ path = "_scripts/painless/_execute"
14
+ params = {}
15
+ body = arguments[:body]
16
+
17
+ perform_request(method, path, params, body).body
18
+ end
19
+
20
+ # Register this action with its valid params when the module is loaded.
21
+ #
22
+ # @since 6.2.0
23
+ ParamsRegistry.register(:scripts_painless_execute, [
24
+ ].freeze)
25
+ end
26
+ end
27
+ end