elasticsearch-api 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -18,8 +18,8 @@ module Elasticsearch
18
18
  # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation
19
19
  # @option arguments [String] :routing Specific routing value
20
20
  # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
21
- # @option arguments [List] :_source_exclude A list of fields to exclude from the returned _source field
22
- # @option arguments [List] :_source_include A list of fields to extract and return from the _source field
21
+ # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
22
+ # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
23
23
  # @option arguments [Number] :version Explicit version number for concurrency control
24
24
  # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
25
25
 
@@ -44,6 +44,7 @@ module Elasticsearch
44
44
  end
45
45
  alias_method :exists?, :exists
46
46
 
47
+
47
48
  # Register this action with its valid params when the module is loaded.
48
49
  #
49
50
  # @since 6.2.0
@@ -55,9 +56,7 @@ module Elasticsearch
55
56
  :refresh,
56
57
  :routing,
57
58
  :_source,
58
- :_source_exclude,
59
59
  :_source_excludes,
60
- :_source_include,
61
60
  :_source_includes,
62
61
  :version,
63
62
  :version_type ].freeze)
@@ -0,0 +1,51 @@
1
+ module Elasticsearch
2
+ module API
3
+ module Actions
4
+
5
+ # The get API allows to get a typed JSON document from the index based on its id.
6
+ #
7
+ # @option arguments [String] :id The document ID (*Required*)
8
+ # @option arguments [String] :index The name of the index (*Required*)
9
+ # @option arguments [String] :type The type of the document; use `_all` to fetch the first document matching the ID across all types (*Required*)
10
+ # @option arguments [String] :parent The ID of the parent document
11
+ # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
12
+ # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
13
+ # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation
14
+ # @option arguments [String] :routing Specific routing value
15
+ # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
16
+ # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
17
+ # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
18
+ # @option arguments [Number] :version Explicit version number for concurrency control
19
+ # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
20
+ #
21
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html
22
+ #
23
+ def exists_source(arguments={})
24
+ raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
25
+ raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
26
+ raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
27
+ method = Elasticsearch::API::HTTP_HEAD
28
+ path = "#{arguments[:index]}/#{arguments[:type]}/#{arguments[:id]}/_source"
29
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
30
+ body = nil
31
+
32
+ perform_request(method, path, params, body).body
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(:exists_source, [
39
+ :parent,
40
+ :preference,
41
+ :realtime,
42
+ :refresh,
43
+ :routing,
44
+ :_source,
45
+ :_source_excludes,
46
+ :_source_includes,
47
+ :version,
48
+ :version_type ].freeze)
49
+ end
50
+ end
51
+ end
@@ -18,29 +18,20 @@ module Elasticsearch
18
18
  # @option arguments [String] :id The document ID (*Required*)
19
19
  # @option arguments [String] :index The name of the index (*Required*)
20
20
  # @option arguments [String] :type The type of the document (*Required*)
21
- # @option arguments [Hash] :body The query definition using the Query DSL (*Required*)
22
- # @option arguments [Boolean] :analyze_wildcard Specify whether wildcards and prefix queries in the query string
23
- # query should be analyzed (default: false)
21
+ # @option arguments [Hash] :body The query definition using the Query DSL
22
+ # @option arguments [Boolean] :analyze_wildcard Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
24
23
  # @option arguments [String] :analyzer The analyzer for the query string query
25
- # @option arguments [String] :default_operator The default operator for query string query (AND or OR)
26
- # (options: AND, OR)
24
+ # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR)
27
25
  # @option arguments [String] :df The default field for query string query (default: _all)
28
- # @option arguments [List] :fields A comma-separated list of fields to return in the response
29
- # @option arguments [Boolean] :lenient Specify whether format-based query failures
30
- # (such as providing text to a numeric field) should be ignored
31
- # @option arguments [Boolean] :lowercase_expanded_terms Specify whether query terms should be lowercased
26
+ # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
27
+ # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
32
28
  # @option arguments [String] :parent The ID of the parent document
33
- # @option arguments [String] :preference Specify the node or shard the operation should be performed on
34
- # (default: random)
29
+ # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
35
30
  # @option arguments [String] :q Query in the Lucene query string syntax
36
31
  # @option arguments [String] :routing Specific routing value
37
- # @option arguments [String] :source The URL-encoded query definition (instead of using the request body)
38
- # @option arguments [String] :_source Specify whether the _source field should be returned,
39
- # or a list of fields to return
40
- # @option arguments [String] :_source_exclude A list of fields to exclude from the returned _source field
41
- # @option arguments [String] :_source_include A list of fields to extract and return from the _source field
42
- # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
43
- #
32
+ # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
33
+ # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
34
+ # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
44
35
  # @see http://elasticsearch.org/guide/reference/api/explain/
45
36
  #
46
37
  def explain(arguments={})
@@ -69,20 +60,15 @@ module Elasticsearch
69
60
  :analyzer,
70
61
  :default_operator,
71
62
  :df,
72
- :fields,
63
+ :stored_fields,
73
64
  :lenient,
74
- :lowercase_expanded_terms,
75
65
  :parent,
76
66
  :preference,
77
67
  :q,
78
68
  :routing,
79
- :source,
80
69
  :_source,
81
- :_source_include,
82
- :_source_includes,
83
- :_source_exclude,
84
70
  :_source_excludes,
85
- :stored_fields ].freeze)
71
+ :_source_includes ].freeze)
86
72
  end
87
73
  end
88
74
  end
@@ -10,12 +10,12 @@ module Elasticsearch
10
10
  #
11
11
  # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
12
12
  # @option arguments [Hash] :body Field json objects containing an array of field names
13
- # @option arguments [List] :fields A comma-separated list of field names (*Required*)
13
+ # @option arguments [List] :fields A comma-separated list of field names
14
14
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
15
15
  # @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)
16
16
  # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, none, all)
17
17
  #
18
- # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html
18
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html
19
19
  #
20
20
  def field_caps(arguments={})
21
21
  raise ArgumentError, "Required argument 'fields' missing" unless arguments[:fields]
@@ -11,25 +11,21 @@ module Elasticsearch
11
11
  # client.get index: 'myindex', type: 'mytype', id: '1'
12
12
  #
13
13
  # @option arguments [String] :id The document ID (*Required*)
14
- # @option arguments [Number,List] :ignore The list of HTTP errors to ignore; only `404` supported at the moment
15
14
  # @option arguments [String] :index The name of the index (*Required*)
16
- # @option arguments [String] :type The type of the document; use `_all` to fetch the first document
17
- # matching the ID across all types) (*Required*)
18
- # @option arguments [List] :fields A comma-separated list of fields to return in the response
15
+ # @option arguments [String] :type The type of the document (use `_all` to fetch the first document matching the ID across all types) (*Required*)
16
+ # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
19
17
  # @option arguments [String] :parent The ID of the parent document
20
- # @option arguments [String] :preference Specify the node or shard the operation should be performed on
21
- # (default: random)
18
+ # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
22
19
  # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
23
20
  # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation
24
21
  # @option arguments [String] :routing Specific routing value
22
+ # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
23
+ # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
24
+ # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
25
+ # @option arguments [List] :_source_exclude A list of fields to exclude from the returned _source field
26
+ # @option arguments [List] :_source_include A list of fields to extract and return from the _source field
25
27
  # @option arguments [Number] :version Explicit version number for concurrency control
26
28
  # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
27
- # @option arguments [String] :_source Specify whether the _source field should be returned,
28
- # or a list of fields to return
29
- # @option arguments [String] :_source_exclude A list of fields to exclude from the returned _source field
30
- # @option arguments [String] :_source_include A list of fields to extract and return from the _source field
31
- # @option arguments [Boolean] :_source_transform Retransform the source before returning it
32
- # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
33
29
  #
34
30
  # @see http://elasticsearch.org/guide/reference/api/get/
35
31
  #
@@ -58,21 +54,19 @@ module Elasticsearch
58
54
  #
59
55
  # @since 6.2.0
60
56
  ParamsRegistry.register(:get, [
61
- :fields,
57
+ :stored_fields,
62
58
  :parent,
63
59
  :preference,
64
60
  :realtime,
65
61
  :refresh,
66
62
  :routing,
67
- :version,
68
- :version_type,
69
63
  :_source,
70
- :_source_include,
64
+ :_source_excludes,
71
65
  :_source_includes,
72
66
  :_source_exclude,
73
- :_source_excludes,
74
- :_source_transform,
75
- :stored_fields ].freeze)
67
+ :_source_include,
68
+ :version,
69
+ :version_type ].freeze)
76
70
  end
77
71
  end
78
72
  end
@@ -5,9 +5,9 @@ module Elasticsearch
5
5
  # Retrieve an indexed script from Elasticsearch
6
6
  #
7
7
  # @option arguments [String] :id Script ID (*Required*)
8
- # @option arguments [String] :lang Script language
8
+ # @option arguments [Time] :master_timeout Specify timeout for connection to master
9
9
  #
10
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html#_indexed_scripts
10
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html
11
11
  #
12
12
  def get_script(arguments={})
13
13
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
@@ -18,6 +18,13 @@ module Elasticsearch
18
18
 
19
19
  perform_request(method, path, params, body).body
20
20
  end
21
+
22
+
23
+ # Register this action with its valid params when the module is loaded.
24
+ #
25
+ # @since 6.2.0
26
+ ParamsRegistry.register(:get_script, [
27
+ :master_timeout ].freeze)
21
28
  end
22
29
  end
23
30
  end
@@ -11,21 +11,18 @@ module Elasticsearch
11
11
  # client.get_source index: 'myindex', type: 'mytype', id: '1'
12
12
  #
13
13
  # @option arguments [String] :id The document ID (*Required*)
14
- # @option arguments [Number,List] :ignore The list of HTTP errors to ignore; only `404` supported at the moment
15
14
  # @option arguments [String] :index The name of the index (*Required*)
16
- # @option arguments [String] :type The type of the document; use `_all` to fetch the first document
17
- # matching the ID across all types) (*Required*)
18
- # @option arguments [List] :fields A comma-separated list of fields to return in the response
15
+ # @option arguments [String] :type The type of the document; use `_all` to fetch the first document matching the ID across all types (*Required*)
19
16
  # @option arguments [String] :parent The ID of the parent document
20
- # @option arguments [String] :preference Specify the node or shard the operation should be performed on
21
- # (default: random)
17
+ # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
22
18
  # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
23
19
  # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation
24
20
  # @option arguments [String] :routing Specific routing value
25
- # @option arguments [String] :_source Specify whether the _source field should be returned,
26
- # or a list of fields to return
27
- # @option arguments [String] :_source_exclude A list of fields to exclude from the returned _source field
28
- # @option arguments [String] :_source_include A list of fields to extract and return from the _source field
21
+ # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return
22
+ # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
23
+ # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
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)
29
26
  #
30
27
  # @see http://elasticsearch.org/guide/reference/api/get/
31
28
  #
@@ -55,17 +52,16 @@ module Elasticsearch
55
52
  #
56
53
  # @since 6.2.0
57
54
  ParamsRegistry.register(:get_source, [
58
- :fields,
59
55
  :parent,
60
56
  :preference,
61
57
  :realtime,
62
58
  :refresh,
63
59
  :routing,
64
60
  :_source,
65
- :_source_include,
61
+ :_source_excludes,
66
62
  :_source_includes,
67
- :_source_exclude,
68
- :_source_excludes ].freeze)
63
+ :version,
64
+ :version_type ].freeze)
69
65
  end
70
66
  end
71
67
  end
@@ -50,23 +50,21 @@ module Elasticsearch
50
50
  # sleep 3 and client.get index: 'myindex', type: 'mytype', id: '1'
51
51
  # # => Elasticsearch::Transport::Transport::Errors::NotFound: [404] ...
52
52
  #
53
- # @option arguments [String] :id Document ID (optional, will be auto-generated if missing)
53
+ # @option arguments [String] :id Document ID
54
54
  # @option arguments [String] :index The name of the index (*Required*)
55
55
  # @option arguments [String] :type The type of the document (*Required*)
56
- # @option arguments [Hash] :body The document
57
- # @option arguments [String] :consistency Explicit write consistency setting for the operation
58
- # (options: one, quorum, all)
56
+ # @option arguments [Hash] :body The document (*Required*)
57
+ # @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)
59
58
  # @option arguments [String] :op_type Explicit operation type (options: index, create)
60
59
  # @option arguments [String] :parent ID of the parent document
61
- # @option arguments [String] :percolate Percolator queries to execute while indexing the document
62
- # @option arguments [Boolean] :refresh Refresh the index after performing the operation
63
- # @option arguments [String] :replication Specific replication type (options: sync, async)
60
+ # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for)
64
61
  # @option arguments [String] :routing Specific routing value
65
62
  # @option arguments [Time] :timeout Explicit operation timeout
66
- # @option arguments [Time] :timestamp Explicit timestamp for the document
67
- # @option arguments [Duration] :ttl Expiration time for the document
68
63
  # @option arguments [Number] :version Explicit version number for concurrency control
69
64
  # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
65
+ # @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
66
+ # @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
67
+ # @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
70
68
  #
71
69
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html
72
70
  #
@@ -88,21 +86,17 @@ module Elasticsearch
88
86
  #
89
87
  # @since 6.2.0
90
88
  ParamsRegistry.register(:index, [
91
- :consistency,
89
+ :wait_for_active_shards,
92
90
  :op_type,
93
91
  :parent,
94
- :percolate,
95
- :pipeline,
96
92
  :refresh,
97
- :replication,
98
93
  :routing,
99
94
  :timeout,
100
- :timestamp,
101
- :ttl,
102
95
  :version,
103
96
  :version_type,
104
97
  :if_seq_no,
105
- :if_primary_term ].freeze)
98
+ :if_primary_term,
99
+ :pipeline ].freeze)
106
100
  end
107
101
  end
108
102
  end
@@ -28,21 +28,7 @@ module Elasticsearch
28
28
  # char_filter: ['html_strip'] }
29
29
  #
30
30
  # @option arguments [String] :index The name of the index to scope the operation
31
- # @option arguments [String] :body The text on which the analysis should be performed
32
- # @option arguments [String] :analyzer The name of the analyzer to use
33
- # @option arguments [String] :field Use the analyzer configured for this field
34
- # (instead of passing the analyzer name)
35
- # @option arguments [List] :filters A comma-separated list of token filters to use for the analysis.
36
- # (Also available as the `:token_filters` option)
37
- # @option arguments [List] :char_filters A comma-separated list of char filters to use for the analysis
38
- # @option arguments [Boolean] :explain Whether to output further details (default: false)
39
- # @option arguments [List] :attributes A comma-separated list of token attributes to output (use with `:explain`)
40
- # @option arguments [String] :index The name of the index to scope the operation
41
- # @option arguments [Boolean] :prefer_local With `true`, specify that a local shard should be used if available,
42
- # with `false`, use a random shard (default: true)
43
- # @option arguments [String] :text The text on which the analysis should be performed
44
- # (when request body is not used)
45
- # @option arguments [String] :tokenizer The name of the tokenizer to use for the analysis
31
+ # @option arguments [Hash] :body Define analyzer/tokenizer parameters and the text on which the analysis should be performed
46
32
  #
47
33
  # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze/
48
34
  #
@@ -58,22 +44,12 @@ module Elasticsearch
58
44
  perform_request(method, path, params, body).body
59
45
  end
60
46
 
47
+ # Register this action with its valid params when the module is loaded.
61
48
  # Register this action with its valid params when the module is loaded.
62
49
  #
63
50
  # @since 6.2.0
64
51
  ParamsRegistry.register(:analyze, [
65
- :analyzer,
66
- :char_filters,
67
- :explain,
68
- :attributes,
69
- :field,
70
- :filters,
71
- :filter,
72
- :index,
73
- :prefer_local,
74
- :text,
75
- :tokenizer,
76
- :token_filters ].freeze)
52
+ :index ].freeze)
77
53
  end
78
54
  end
79
55
  end
@@ -23,15 +23,14 @@ module Elasticsearch
23
23
  # client.indices.clear_cache field_data: true, fields: 'created_at', filter_cache: false, id_cache: false
24
24
  #
25
25
  # @option arguments [List] :index A comma-separated list of index name to limit the operation
26
- # @option arguments [Boolean] :field_data Clear field data
26
+ # @option arguments [Boolean] :field_data Clear field data. This is deprecated. Prefer `fielddata`.
27
27
  # @option arguments [Boolean] :fielddata Clear field data
28
- # @option arguments [List] :fields A comma-separated list of fields to clear when using the `field_data` parameter (default: all)
28
+ # @option arguments [List] :fields A comma-separated list of fields to clear when using the `fielddata` parameter (default: all)
29
29
  # @option arguments [Boolean] :query Clear query caches
30
30
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
31
31
  # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
32
32
  # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, none, all)
33
33
  # @option arguments [List] :index A comma-separated list of index name to limit the operation
34
- # @option arguments [Boolean] :recycler Clear the recycler cache
35
34
  # @option arguments [Boolean] :request_cache Clear request cache
36
35
  # @option arguments [Boolean] :request Clear request cache
37
36
  #
@@ -61,7 +60,6 @@ module Elasticsearch
61
60
  :allow_no_indices,
62
61
  :expand_wildcards,
63
62
  :index,
64
- :recycler,
65
63
  :request_cache,
66
64
  :request ].freeze)
67
65
  end
@@ -11,20 +11,14 @@ module Elasticsearch
11
11
  #
12
12
  # client.indices.close index: 'myindex'
13
13
  #
14
- # @option arguments [List] :index A comma separated list of indices to perform the operation on
15
- # (*Required*)
16
- # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
17
- # no concrete indices. (This includes `_all` string or when no
18
- # indices have been specified)
19
- # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that
20
- # are open, closed or both. (options: open, closed)
21
- # @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore
22
- # `missing` ones (options: none, missing) @until 1.0
23
- # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
24
- # unavailable (missing, closed, etc)
14
+ # @option arguments [List] :index A comma separated list of indices to close (*Required*)
25
15
  # @option arguments [Time] :timeout Explicit operation timeout
16
+ # @option arguments [Time] :master_timeout Specify timeout for connection to master
17
+ # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
18
+ # @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)
19
+ # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, none, all)
26
20
  #
27
- # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-open-close/
21
+ # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html
28
22
  #
29
23
  def close(arguments={})
30
24
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
@@ -41,11 +35,11 @@ module Elasticsearch
41
35
  #
42
36
  # @since 6.2.0
43
37
  ParamsRegistry.register(:close, [
44
- :ignore_indices,
38
+ :timeout,
39
+ :master_timeout,
45
40
  :ignore_unavailable,
46
41
  :allow_no_indices,
47
- :expand_wildcards,
48
- :timeout ].freeze)
42
+ :expand_wildcards ].freeze)
49
43
  end
50
44
  end
51
45
  end