elasticsearch-api 6.2.0 → 6.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) 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/search_spec.rb +0 -15
  136. data/test/integration/yaml_test_runner.rb +2 -4
  137. data/utils/thor/generate_source.rb +1 -0
  138. data/utils/thor/templates/ruby/method.erb +7 -5
  139. metadata +12 -73
  140. data/lib/elasticsearch/api/actions/delete_template.rb +0 -21
  141. data/lib/elasticsearch/api/actions/field_stats.rb +0 -36
  142. data/lib/elasticsearch/api/actions/get_template.rb +0 -27
  143. data/lib/elasticsearch/api/actions/indices/delete_mapping.rb +0 -26
  144. data/lib/elasticsearch/api/actions/indices/delete_warmer.rb +0 -32
  145. data/lib/elasticsearch/api/actions/indices/get_aliases.rb +0 -37
  146. data/lib/elasticsearch/api/actions/indices/get_warmer.rb +0 -62
  147. data/lib/elasticsearch/api/actions/indices/optimize.rb +0 -77
  148. data/lib/elasticsearch/api/actions/indices/put_warmer.rb +0 -65
  149. data/lib/elasticsearch/api/actions/indices/seal.rb +0 -24
  150. data/lib/elasticsearch/api/actions/indices/snapshot_index.rb +0 -44
  151. data/lib/elasticsearch/api/actions/indices/status.rb +0 -63
  152. data/lib/elasticsearch/api/actions/list_benchmarks.rb +0 -27
  153. data/lib/elasticsearch/api/actions/mlt.rb +0 -130
  154. data/lib/elasticsearch/api/actions/mpercolate.rb +0 -62
  155. data/lib/elasticsearch/api/actions/nodes/shutdown.rb +0 -39
  156. data/lib/elasticsearch/api/actions/percolate.rb +0 -73
  157. data/lib/elasticsearch/api/actions/put_template.rb +0 -25
  158. data/lib/elasticsearch/api/actions/remote/info.rb +0 -21
  159. data/lib/elasticsearch/api/actions/search_exists.rb +0 -63
  160. data/lib/elasticsearch/api/actions/suggest.rb +0 -49
  161. data/spec/elasticsearch/api/actions/delete_template_spec.rb +0 -17
  162. data/spec/elasticsearch/api/actions/field_stats_spec.rb +0 -17
  163. data/spec/elasticsearch/api/actions/get_template_spec.rb +0 -52
  164. data/spec/elasticsearch/api/actions/indices/delete_mapping_spec.rb +0 -77
  165. data/spec/elasticsearch/api/actions/indices/delete_warmer_spec.rb +0 -86
  166. data/spec/elasticsearch/api/actions/indices/freeze_spec.rb +0 -68
  167. data/spec/elasticsearch/api/actions/indices/get_aliases_spec.rb +0 -55
  168. data/spec/elasticsearch/api/actions/indices/get_warmer_spec.rb +0 -48
  169. data/spec/elasticsearch/api/actions/indices/optimize_spec.rb +0 -63
  170. data/spec/elasticsearch/api/actions/indices/put_warmer_spec.rb +0 -101
  171. data/spec/elasticsearch/api/actions/indices/seal_spec.rb +0 -18
  172. data/spec/elasticsearch/api/actions/indices/snapshot_index_spec.rb +0 -89
  173. data/spec/elasticsearch/api/actions/indices/stats_spec.rb +0 -108
  174. data/spec/elasticsearch/api/actions/indices/status_spec.rb +0 -92
  175. data/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +0 -68
  176. data/spec/elasticsearch/api/actions/list_benchmarks_spec.rb +0 -17
  177. data/spec/elasticsearch/api/actions/mlt_spec.rb +0 -117
  178. data/spec/elasticsearch/api/actions/mpercolate_spec.rb +0 -49
  179. data/spec/elasticsearch/api/actions/nodes/shutdown_spec.rb +0 -59
  180. data/spec/elasticsearch/api/actions/percolate_spec.rb +0 -67
  181. data/spec/elasticsearch/api/actions/put_template_spec.rb +0 -17
  182. data/spec/elasticsearch/api/actions/remote/info_spec.rb +0 -18
  183. data/spec/elasticsearch/api/actions/search_exists_spec.rb +0 -17
  184. data/spec/elasticsearch/api/actions/suggest_spec.rb +0 -77
@@ -1,63 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Indices
4
- module Actions
5
-
6
- # Return information about one or more indices
7
- #
8
- # @example Get information about all indices
9
- #
10
- # client.indices.status
11
- #
12
- # @example Get information about a specific index
13
- #
14
- # client.indices.status index: 'foo'
15
- #
16
- # @example Get information about shard recovery for a specific index
17
- #
18
- # client.indices.status index: 'foo', recovery: true
19
- #
20
- # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
21
- # to perform the operation on all indices
22
- # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
23
- # no concrete indices. (This includes `_all` string or when no
24
- # indices have been specified)
25
- # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that
26
- # are open, closed or both. (options: open, closed)
27
- # @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore
28
- # `missing` ones (options: none, missing) @until 1.0
29
- # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
30
- # unavailable (missing, closed, etc)
31
- # @option arguments [Boolean] :recovery Return information about shard recovery (progress, size, etc)
32
- # @option arguments [Boolean] :snapshot Return information about snapshots (when shared gateway is used)
33
- #
34
- # @see http://elasticsearch.org/guide/reference/api/admin-indices-status/
35
- #
36
- def status(arguments={})
37
- method = HTTP_GET
38
- path = Utils.__pathify Utils.__listify(arguments[:index]), '_status'
39
-
40
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
41
- body = nil
42
-
43
- if Array(arguments[:ignore]).include?(404)
44
- Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
45
- else
46
- perform_request(method, path, params, body).body
47
- end
48
- end
49
-
50
- # Register this action with its valid params when the module is loaded.
51
- #
52
- # @since 6.2.0
53
- ParamsRegistry.register(:status, [
54
- :ignore_indices,
55
- :ignore_unavailable,
56
- :allow_no_indices,
57
- :expand_wildcards,
58
- :recovery,
59
- :snapshot ].freeze)
60
- end
61
- end
62
- end
63
- end
@@ -1,27 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Actions
4
-
5
- # Return a list of running benchmarks
6
- #
7
- # @example
8
- #
9
- # client.list_benchmarks
10
- #
11
- # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
12
- # to perform the operation on all indices
13
- # @option arguments [String] :type The name of the document type
14
- #
15
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html
16
- #
17
- def list_benchmarks(arguments={})
18
- method = HTTP_GET
19
- path = "_bench"
20
- params = {}
21
- body = nil
22
-
23
- perform_request(method, path, params, body).body
24
- end
25
- end
26
- end
27
- end
@@ -1,130 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Actions
4
-
5
- # Return documents similar to the specified one.
6
- #
7
- # Performs a `more_like_this` query with the specified document as the input.
8
- #
9
- # @example Search for similar documents using the `title` property of document `myindex/mytype/1`
10
- #
11
- # # First, let's setup a synonym-aware analyzer ("quick" <=> "fast")
12
- # client.indices.create index: 'myindex', body: {
13
- # settings: {
14
- # analysis: {
15
- # filter: {
16
- # synonyms: {
17
- # type: 'synonym',
18
- # synonyms: [ "quick,fast" ]
19
- # }
20
- # },
21
- # analyzer: {
22
- # title_synonym: {
23
- # type: 'custom',
24
- # tokenizer: 'whitespace',
25
- # filter: ['lowercase', 'stop', 'snowball', 'synonyms']
26
- # }
27
- # }
28
- # }
29
- # },
30
- # mappings: {
31
- # mytype: {
32
- # properties: {
33
- # title: {
34
- # type: 'string',
35
- # analyzer: 'title_synonym'
36
- # }
37
- # }
38
- # }
39
- # }
40
- # }
41
- #
42
- # # Index three documents
43
- # client.index index: 'myindex', type: 'mytype', id: 1, body: { title: 'Quick Brown Fox' }
44
- # client.index index: 'myindex', type: 'mytype', id: 2, body: { title: 'Slow Black Dog' }
45
- # client.index index: 'myindex', type: 'mytype', id: 3, body: { title: 'Fast White Rabbit' }
46
- # client.indices.refresh index: 'myindex'
47
- #
48
- # client.mlt index: 'myindex', type: 'mytype', id: 1, mlt_fields: 'title', min_doc_freq: 1, min_term_freq: 1
49
- # # => { ... {"title"=>"Fast White Rabbit"}}]}}
50
- #
51
- # @option arguments [String] :id The document ID (*Required*)
52
- # @option arguments [String] :index The name of the index (*Required*)
53
- # @option arguments [String] :type The type of the document (use `_all` to fetch
54
- # the first document matching the ID across all types) (*Required*)
55
- # @option arguments [Hash] :body A specific search request definition
56
- # @option arguments [Number] :boost_terms The boost factor
57
- # @option arguments [Number] :max_doc_freq The word occurrence frequency as count: words with higher occurrence
58
- # in the corpus will be ignored
59
- # @option arguments [Number] :max_query_terms The maximum query terms to be included in the generated query
60
- # @option arguments [Number] :max_word_len The minimum length of the word: longer words will be ignored
61
- # @option arguments [Number] :min_doc_freq The word occurrence frequency as count: words with lower occurrence
62
- # in the corpus will be ignored
63
- # @option arguments [Number] :min_term_freq The term frequency as percent: terms with lower occurence
64
- # in the source document will be ignored
65
- # @option arguments [Number] :min_word_len The minimum length of the word: shorter words will be ignored
66
- # @option arguments [List] :mlt_fields Specific fields to perform the query against
67
- # @option arguments [Number] :percent_terms_to_match How many terms have to match in order to consider
68
- # the document a match (default: 0.3)
69
- # @option arguments [String] :routing Specific routing value
70
- # @option arguments [Number] :search_from The offset from which to return results
71
- # @option arguments [List] :search_indices A comma-separated list of indices to perform the query against
72
- # (default: the index containing the document)
73
- # @option arguments [String] :search_query_hint The search query hint
74
- # @option arguments [String] :search_scroll A scroll search request definition
75
- # @option arguments [Number] :search_size The number of documents to return (default: 10)
76
- # @option arguments [String] :search_source A specific search request definition (instead of using the request body)
77
- # @option arguments [String] :search_type Specific search type (eg. `dfs_then_fetch`, `count`, etc)
78
- # @option arguments [List] :search_types A comma-separated list of types to perform the query against
79
- # (default: the same type as the document)
80
- # @option arguments [List] :stop_words A list of stop words to be ignored
81
- #
82
- # @see http://elasticsearch.org/guide/reference/api/more-like-this/
83
- #
84
- def mlt(arguments={})
85
- raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
86
- raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
87
- raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
88
- method = HTTP_GET
89
- path = Utils.__pathify Utils.__escape(arguments[:index]),
90
- Utils.__escape(arguments[:type]),
91
- Utils.__escape(arguments[:id]),
92
- '_mlt'
93
-
94
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
95
-
96
- [:mlt_fields, :search_indices, :search_types, :stop_words].each do |name|
97
- params[name] = Utils.__listify(params[name]) if params[name]
98
- end
99
-
100
- body = arguments[:body]
101
-
102
- perform_request(method, path, params, body).body
103
- end
104
-
105
- # Register this action with its valid params when the module is loaded.
106
- #
107
- # @since 6.2.0
108
- ParamsRegistry.register(:mlt, [
109
- :boost_terms,
110
- :max_doc_freq,
111
- :max_query_terms,
112
- :max_word_len,
113
- :min_doc_freq,
114
- :min_term_freq,
115
- :min_word_len,
116
- :mlt_fields,
117
- :percent_terms_to_match,
118
- :routing,
119
- :search_from,
120
- :search_indices,
121
- :search_query_hint,
122
- :search_scroll,
123
- :search_size,
124
- :search_source,
125
- :search_type,
126
- :search_types,
127
- :stop_words ].freeze)
128
- end
129
- end
130
- end
@@ -1,62 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Actions
4
-
5
- # Perform multiple percolate operations in a single request, similar to the {#msearch} API
6
- #
7
- # Pass the percolate definitions as header-body pairs in the `:body` argument, as an Array of Hashes.
8
- #
9
- # @example Perform two different percolations in a single request
10
- #
11
- # client.mpercolate \
12
- # body: [
13
- # { percolate: { index: "my-index", type: "my-type" } },
14
- # { doc: { message: "foo bar" } },
15
- # { percolate: { index: "my-other-index", type: "my-other-type", id: "1" } },
16
- # { }
17
- # ]
18
- #
19
- # @option arguments [String] :index The index of the document being count percolated to use as default
20
- # @option arguments [String] :type The type of the document being percolated to use as default.
21
- # @option arguments [Array<Hash>] The percolate request definitions (header & body pairs) (*Required*)
22
- # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
23
- # unavailable (missing or closed)
24
- # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
25
- # no concrete indices. (This includes `_all` string or when no
26
- # indices have been specified)
27
- # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are
28
- # open, closed or both. (options: open, closed)
29
- #
30
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-percolate.html
31
- #
32
- def mpercolate(arguments={})
33
- raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
34
- method = HTTP_GET
35
- path = "_mpercolate"
36
-
37
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
38
- body = arguments[:body]
39
-
40
- case
41
- when body.is_a?(Array)
42
- payload = body.map { |d| d.is_a?(String) ? d : Elasticsearch::API.serializer.dump(d) }
43
- payload << "" unless payload.empty?
44
- payload = payload.join("\n")
45
- else
46
- payload = body
47
- end
48
-
49
- perform_request(method, path, params, payload).body
50
- end
51
-
52
- # Register this action with its valid params when the module is loaded.
53
- #
54
- # @since 6.2.0
55
- ParamsRegistry.register(:mpercolate, [
56
- :ignore_unavailable,
57
- :allow_no_indices,
58
- :expand_wildcards,
59
- :percolate_format ].freeze)
60
- end
61
- end
62
- end
@@ -1,39 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Nodes
4
- module Actions
5
-
6
- # Shutdown one or all nodes
7
- #
8
- # @example Shut down node named _Bloke_
9
- #
10
- # client.nodes.shutdown node_id: 'Bloke'
11
- #
12
- # @option arguments [List] :node_id A comma-separated list of node IDs or names to perform the operation on; use
13
- # `_local` to shutdown the node you're connected to, leave empty to
14
- # shutdown all nodes
15
- # @option arguments [Time] :delay Set the delay for the operation (default: 1s)
16
- # @option arguments [Boolean] :exit Exit the JVM as well (default: true)
17
- #
18
- # @see http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown/
19
- #
20
- def shutdown(arguments={})
21
- method = HTTP_POST
22
- path = Utils.__pathify '_cluster/nodes', Utils.__listify(arguments[:node_id]), '_shutdown'
23
-
24
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
25
- body = nil
26
-
27
- perform_request(method, path, params, body).body
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(:shutdown, [
34
- :delay,
35
- :exit ].freeze)
36
- end
37
- end
38
- end
39
- end
@@ -1,73 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Actions
4
-
5
- # Return names of queries matching a document.
6
- #
7
- # Percolator allows you to register queries and then evaluate a document against them:
8
- # the IDs of matching queries are returned in the response.
9
- #
10
- # @deprecated The `_percolate` API has been deprecated in favour of a special field mapping and the
11
- # `percolate` query;
12
- # see https://www.elastic.co/guide/en/elasticsearch/reference/5.5/breaking_50_percolator.html
13
- #
14
- # See full example for Elasticsearch 5.x and higher in <https://github.com/elastic/elasticsearch-ruby/blob/master/examples/percolator/percolator_alerts.rb>
15
- #
16
- # @option arguments [String] :index The index of the document being percolated. (*Required*)
17
- # @option arguments [String] :type The type of the document being percolated. (*Required*)
18
- # @option arguments [String] :id Fetch the document specified by index/type/id and
19
- # use it instead of the passed `doc`
20
- # @option arguments [Hash] :body The percolator request definition using the percolate DSL
21
- # @option arguments [List] :routing A comma-separated list of specific routing values
22
- # @option arguments [String] :preference Specify the node or shard the operation should be performed on
23
- # (default: random)
24
- # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
25
- # unavailable (missing or closed)
26
- # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
27
- # no concrete indices. (This includes `_all` string or when no
28
- # indices have been specified)
29
- # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are
30
- # open, closed or both. (options: open, closed)
31
- # @option arguments [String] :percolate_index The index to percolate the document into. Defaults to passed `index`.
32
- # @option arguments [String] :percolate_format Return an array of matching query IDs instead of objects.
33
- # (options: ids)
34
- # @option arguments [String] :percolate_type The type to percolate document into. Defaults to passed `type`.
35
- # @option arguments [Number] :version Explicit version number for concurrency control
36
- # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
37
- #
38
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-percolate.html
39
- #
40
- def percolate(arguments={})
41
- Utils.__report_unsupported_method :percolate
42
-
43
- raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
44
- raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
45
- method = HTTP_GET
46
- path = Utils.__pathify Utils.__escape(arguments[:index]),
47
- Utils.__escape(arguments[:type]),
48
- Utils.__escape(arguments[:id]),
49
- '_percolate'
50
-
51
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
52
- body = arguments[:body]
53
-
54
- perform_request(method, path, params, body).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(:percolate, [
61
- :routing,
62
- :preference,
63
- :ignore_unavailable,
64
- :allow_no_indices,
65
- :expand_wildcards,
66
- :percolate_index,
67
- :percolate_type,
68
- :percolate_format,
69
- :version,
70
- :version_type ].freeze)
71
- end
72
- end
73
- end
@@ -1,25 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Actions
4
-
5
- # Store a template for the search definition in Elasticsearch,
6
- # to be later used with the `search_template` method
7
- #
8
- # @option arguments [String] :id Template ID (*Required*)
9
- # @option arguments [Hash] :body The document (*Required*)
10
- #
11
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html
12
- #
13
- def put_template(arguments={})
14
- raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
15
- raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
16
- method = HTTP_POST
17
- path = "_scripts/#{arguments[:id]}"
18
- params = {}
19
- body = arguments[:body]
20
-
21
- perform_request(method, path, params, body).body
22
- end
23
- end
24
- end
25
- end
@@ -1,21 +0,0 @@
1
- module Elasticsearch
2
- module API
3
- module Remote
4
- module Actions
5
-
6
- # Returns all of the configured remote cluster information
7
- #
8
- # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/remote-info.html
9
- #
10
- def info(arguments={})
11
- method = HTTP_GET
12
- path = "_remote/info"
13
- params = {}
14
- body = nil
15
-
16
- perform_request(method, path, params, body).body
17
- end
18
- end
19
- end
20
- end
21
- end