[[reference-delete_by_query]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
[[client.deleteByQuery]]
=== client.deleteByQuery

Delete documents. Deletes documents that match the specified query.

{ref}/docs-delete-by-query.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(DeleteByQueryRequest, options?): Promise<DeleteByQueryResponse>
----

[discrete]
==== Request

[pass]
++++
<pre>
++++
interface DeleteByQueryRequest extends <<RequestBase>> {
  index: <<Indices>>
  allow_no_indices?: boolean
  analyzer?: string
  analyze_wildcard?: boolean
  conflicts?: <<Conflicts>>
  default_operator?: <<QueryDslOperator>>
  df?: string
  expand_wildcards?: <<ExpandWildcards>>
  from?: <<long>>
  ignore_unavailable?: boolean
  lenient?: boolean
  preference?: string
  refresh?: boolean
  request_cache?: boolean
  requests_per_second?: <<float>>
  routing?: <<Routing>>
  q?: string
  scroll?: <<Duration>>
  scroll_size?: <<long>>
  search_timeout?: <<Duration>>
  search_type?: <<SearchType>>
  slices?: <<Slices>>
  sort?: string[]
  stats?: string[]
  terminate_after?: <<long>>
  timeout?: <<Duration>>
  version?: boolean
  wait_for_active_shards?: <<WaitForActiveShards>>
  wait_for_completion?: boolean
  max_docs?: <<long>>
  query?: <<QueryDslQueryContainer>>
  slice?: <<SlicedScroll>>
}

[pass]
++++
</pre>
++++
[discrete]
==== Response

[pass]
++++
<pre>
++++
interface DeleteByQueryResponse {
  batches?: <<long>>
  deleted?: <<long>>
  failures?: <<BulkIndexByScrollFailure>>[]
  noops?: <<long>>
  requests_per_second?: <<float>>
  retries?: <<Retries>>
  slice_id?: <<integer>>
  task?: <<TaskId>>
  throttled?: <<Duration>>
  throttled_millis?: <<DurationValue>><<<UnitMillis>>>
  throttled_until?: <<Duration>>
  throttled_until_millis?: <<DurationValue>><<<UnitMillis>>>
  timed_out?: boolean
  took?: <<DurationValue>><<<UnitMillis>>>
  total?: <<long>>
  version_conflicts?: <<long>>
}

[pass]
++++
</pre>
++++
