Skip to content

Commit e0a2cc4

Browse files
committed
[API] Update top-level api endpoints
1 parent ed94fc1 commit e0a2cc4

38 files changed

+461
-1002
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,16 @@ module Actions
6666
#
6767
# @option arguments [String] :index Default index for items which don't provide one
6868
# @option arguments [String] :type Default document type for items which don't provide one
69-
# @option arguments [Hash] :body The operation definition and data (action-data pairs), separated by newlines (*Required*). Note that this cannot be empty.
70-
# @option arguments [Boolean] :include_type_name Whether a type should be expected in the body of the mappings.
69+
# @option arguments [Hash] :body The operation definition and data (action-data pairs), separated by newlines (*Required*)
7170
# @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the bulk 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)
7271
# @option arguments [String] :refresh If `true` then refresh the effected 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)
7372
# @option arguments [String] :routing Specific routing value
7473
# @option arguments [Time] :timeout Explicit operation timeout
7574
# @option arguments [String] :type Default document type for items which don't provide one
76-
# @option arguments [List] :fields Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request
7775
# @option arguments [List] :_source True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request
78-
# @option arguments [List] :_source_exclude Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
79-
# @option arguments [List] :_source_include Default list of fields to extract and return from the _source field, can be overridden on each sub-request
80-
# @option arguments [String] :pipeline The pipeline ID to preprocess incoming documents with
76+
# @option arguments [List] :_source_excludes Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
77+
# @option arguments [List] :_source_includes Default list of fields to extract and return from the _source field, can be overridden on each sub-request
78+
# @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with
8179
#
8280
# @return [Hash] Deserialized Elasticsearch response
8381
#
@@ -112,12 +110,10 @@ def bulk(arguments={})
112110
:routing,
113111
:timeout,
114112
:type,
115-
:fields,
116113
:_source,
117114
:_source_excludes,
118115
:_source_includes,
119-
:pipeline,
120-
:include_type_name ].freeze)
116+
:pipeline ].freeze)
121117
end
122118
end
123119
end

elasticsearch-api/lib/elasticsearch/api/actions/clear_scroll.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,14 @@ module Actions
2121

2222
# Abort a particular scroll search and clear all the resources associated with it.
2323
#
24-
# @option arguments [List] :scroll_id A comma-separated list of scroll IDs to clear;
25-
# use `_all` clear all scroll search contexts
24+
# @option arguments [List] :scroll_id A comma-separated list of scroll IDs to clear
25+
# @option arguments [Hash] :body A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
2626
#
27-
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-search-type.html#clear-scroll
27+
# @see http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html
2828
#
2929
def clear_scroll(arguments={})
30-
raise ArgumentError, "Required argument 'scroll_id' missing" unless arguments[:scroll_id]
31-
32-
method = HTTP_DELETE
33-
path = Utils.__pathify '_search/scroll', Utils.__listify(arguments.delete(:scroll_id))
30+
method = Elasticsearch::API::HTTP_DELETE
31+
path = "_search/scroll/#{arguments[:scroll_id]}"
3432
params = {}
3533
body = arguments[:body]
3634

elasticsearch-api/lib/elasticsearch/api/actions/count.rb

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,24 @@ module Actions
3333
#
3434
# index: 'my_index', body: { filtered: { filter: { terms: { foo: ['bar'] } } } }
3535
#
36+
#
3637
# @option arguments [List] :index A comma-separated list of indices to restrict the results
3738
# @option arguments [List] :type A comma-separated list of types to restrict the results
3839
# @option arguments [Hash] :body A query to restrict the results specified with the Query DSL (optional)
39-
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
40-
# unavailable (missing or closed)
41-
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves
42-
# into no concrete indices.
43-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices
44-
# that are open, closed or both.
45-
# (options: open, closed, none, all)
40+
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
41+
# @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled
42+
# @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)
43+
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, none, all)
4644
# @option arguments [Number] :min_score Include only documents with a specific `_score` value in the result
47-
# @option arguments [String] :preference Specify the node or shard the operation should be performed on
48-
# (default: random)
49-
# @option arguments [String] :routing Specific routing value
45+
# @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
46+
# @option arguments [List] :routing A comma-separated list of specific routing values
5047
# @option arguments [String] :q Query in the Lucene query string syntax
5148
# @option arguments [String] :analyzer The analyzer to use for the query string
52-
# @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be
53-
# analyzed (default: false)
54-
# @option arguments [String] :default_operator The default operator for query string query (AND or OR)
55-
# (options: AND, OR)
56-
# @option arguments [String] :df The field to use as default where no field prefix is given in the query
57-
# string
58-
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text
59-
# to a numeric field) should be ignored
60-
# @option arguments [Boolean] :lowercase_expanded_terms Specify whether query terms should be lowercased
61-
#
62-
# @option arguments [Boolean] :terminate_after Specify the maximum count for each shard, upon reaching
63-
# which the query execution will terminate early.
49+
# @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false)
50+
# @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR)
51+
# @option arguments [String] :df The field to use as default where no field prefix is given in the query string
52+
# @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
53+
# @option arguments [Number] :terminate_after The maximum count for each shard, upon reaching which the query execution will terminate early
6454
#
6555
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html
6656
#
@@ -79,6 +69,7 @@ def count(arguments={})
7969
# @since 6.1.1
8070
ParamsRegistry.register(:count, [
8171
:ignore_unavailable,
72+
:ignore_throttled,
8273
:allow_no_indices,
8374
:expand_wildcards,
8475
:min_score,
@@ -90,7 +81,6 @@ def count(arguments={})
9081
:default_operator,
9182
:df,
9283
:lenient,
93-
:lowercase_expanded_terms,
9484
:terminate_after ].freeze)
9585
end
9686
end

elasticsearch-api/lib/elasticsearch/api/actions/count_percolate.rb

Lines changed: 0 additions & 98 deletions
This file was deleted.

elasticsearch-api/lib/elasticsearch/api/actions/delete.rb

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,15 @@ module Actions
3030
# client.delete index: 'myindex', type: 'mytype', id: '1', routing: 'abc123'
3131
#
3232
# @option arguments [String] :id The document ID (*Required*)
33-
# @option arguments [Number,List] :ignore The list of HTTP errors to ignore; only `404` supported at the moment
3433
# @option arguments [String] :index The name of the index (*Required*)
35-
# @option arguments [String] :type The type of the document (*Required*)
36-
# @option arguments [String] :consistency Specific write consistency setting for the operation
37-
# (options: one, quorum, all)
38-
# @option arguments [Boolean] :include_type_name Whether a type should be expected in the body of the mappings.
34+
# @option arguments [String] :type The type of the document
35+
# @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
3936
# @option arguments [String] :parent ID of parent document
40-
# @option arguments [Boolean] :refresh Refresh the index after performing the operation
41-
# @option arguments [String] :replication Specific replication type (options: sync, async)
37+
# @option arguments [String] :refresh If `true` then refresh the effected 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)
4238
# @option arguments [String] :routing Specific routing value
4339
# @option arguments [Time] :timeout Explicit operation timeout
40+
# @option arguments [Number] :if_seq_no only perform the delete operation if the last operation that has changed the document has the specified sequence number
41+
# @option arguments [Number] :if_primary_term only perform the delete operation if the last operation that has changed the document has the specified primary term
4442
# @option arguments [Number] :version Explicit version number for concurrency control
4543
# @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
4644
#
@@ -70,17 +68,15 @@ def delete(arguments={})
7068
#
7169
# @since 6.1.1
7270
ParamsRegistry.register(:delete, [
73-
:consistency,
71+
:wait_for_active_shards,
7472
:parent,
7573
:refresh,
76-
:if_seq_no,
77-
:replication,
7874
:routing,
7975
:timeout,
80-
:version,
81-
:version_type,
76+
:if_seq_no,
8277
:if_primary_term,
83-
:include_type_name ].freeze)
78+
:version,
79+
:version_type ].freeze)
8480
end
8581
end
8682
end

0 commit comments

Comments
 (0)