Module: Elasticsearch::XPack::API::AsyncSearch::Actions
- Included in:
- AsyncSearchClient
- Defined in:
- lib/elasticsearch/xpack/api/namespace/async_search.rb,
lib/elasticsearch/xpack/api/actions/async_search/get.rb,
lib/elasticsearch/xpack/api/actions/async_search/delete.rb,
lib/elasticsearch/xpack/api/actions/async_search/status.rb,
lib/elasticsearch/xpack/api/actions/async_search/submit.rb,
lib/elasticsearch/xpack/api/actions/async_search/params_registry.rb
Defined Under Namespace
Modules: ParamsRegistry
Instance Method Summary collapse
-
#delete(arguments = {}) ⇒ Object
Deletes an async search by ID.
-
#get(arguments = {}) ⇒ Object
Retrieves the results of a previously submitted async search request given its ID.
-
#status(arguments = {}) ⇒ Object
Retrieves the status of a previously submitted async search request given its ID.
-
#submit(arguments = {}) ⇒ Object
Executes a search request asynchronously.
Instance Method Details
#delete(arguments = {}) ⇒ Object
Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/elasticsearch/xpack/api/actions/async_search/delete.rb', line 30 def delete(arguments = {}) raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] headers = arguments.delete(:headers) || {} arguments = arguments.clone _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE path = "_async_search/#{Elasticsearch::API::Utils.__listify(_id)}" params = {} body = nil perform_request(method, path, params, body, headers).body end |
#get(arguments = {}) ⇒ Object
Retrieves the results of a previously submitted async search request given its ID.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch/xpack/api/actions/async_search/get.rb', line 33 def get(arguments = {}) raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] headers = arguments.delete(:headers) || {} arguments = arguments.clone _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET path = "_async_search/#{Elasticsearch::API::Utils.__listify(_id)}" params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body, headers).body end |
#status(arguments = {}) ⇒ Object
Retrieves the status of a previously submitted async search request given its ID.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/elasticsearch/xpack/api/actions/async_search/status.rb', line 30 def status(arguments = {}) raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] headers = arguments.delete(:headers) || {} arguments = arguments.clone _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET path = "_async_search/status/#{Elasticsearch::API::Utils.__listify(_id)}" params = {} body = nil perform_request(method, path, params, body, headers).body end |
#submit(arguments = {}) ⇒ Object
Executes a search request asynchronously.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/elasticsearch/xpack/api/actions/async_search/submit.rb', line 72 def submit(arguments = {}) headers = arguments.delete(:headers) || {} arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Elasticsearch::API::Utils.__listify(_index)}/_async_search" else "_async_search" end params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body, headers).body end |