Class: ElastomerClient::Client::NativeDeleteByQuery
- Inherits:
-
Object
- Object
- ElastomerClient::Client::NativeDeleteByQuery
- Defined in:
- lib/elastomer_client/client/native_delete_by_query.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(client, query, parameters) ⇒ NativeDeleteByQuery
constructor
A new instance of NativeDeleteByQuery.
Constructor Details
#initialize(client, query, parameters) ⇒ NativeDeleteByQuery
Returns a new instance of NativeDeleteByQuery.
25 26 27 28 29 |
# File 'lib/elastomer_client/client/native_delete_by_query.rb', line 25 def initialize(client, query, parameters) @client = client @query = query @parameters = parameters end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
23 24 25 |
# File 'lib/elastomer_client/client/native_delete_by_query.rb', line 23 def client @client end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
23 24 25 |
# File 'lib/elastomer_client/client/native_delete_by_query.rb', line 23 def parameters @parameters end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
23 24 25 |
# File 'lib/elastomer_client/client/native_delete_by_query.rb', line 23 def query @query end |
Instance Method Details
#execute ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/elastomer_client/client/native_delete_by_query.rb', line 31 def execute # TODO: Require index parameter. type is optional. updated_params = parameters.merge(body: query, action: "delete_by_query", rest_api: "delete_by_query") updated_params.delete(:type) if client.version_support.es_version_8_plus? response = client.post("/{index}{/type}/_delete_by_query", updated_params) response.body end |