Method: Elasticsearch::API::Actions#delete_by_query
- Defined in:
- lib/elasticsearch/api/actions/delete_by_query.rb
#delete_by_query(arguments = {}) ⇒ Object
Delete documents which match specified query.
Provide the query either as a “query string” query in the :q argument, or using the Elasticsearch’s [Query DSL](www.elasticsearch.org/guide/reference/query-dsl/) in the :body argument.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/elasticsearch/api/actions/delete_by_query.rb', line 45 def delete_by_query(arguments={}) Utils.__report_unsupported_method(__method__) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] valid_params = [ :analyzer, :consistency, :default_operator, :df, :ignore_indices, :ignore_unavailable, :allow_no_indices, :expand_wildcards, :replication, :q, :routing, :source, :timeout ] method = HTTP_DELETE path = Utils.__pathify Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), '/_query' params = Utils.__validate_and_extract_params arguments, valid_params body = arguments[:body] perform_request(method, path, params, body).body end |