@@ -53,13 +53,13 @@ POST /my-index-000001/_delete_by_query
5353==== {api-description-title}
5454
5555You can specify the query criteria in the request URI or the request body
56- using the same syntax as the <<search-search,Search API>>.
56+ using the same syntax as the <<search-search,Search API>>.
5757
5858When you submit a delete by query request, {es} gets a snapshot of the data stream or index
5959when it begins processing the request and deletes matching documents using
6060`internal` versioning. If a document changes between the time that the
6161snapshot is taken and the delete operation is processed, it results in a version
62- conflict and the delete operation fails.
62+ conflict and the delete operation fails.
6363
6464NOTE: Documents with a version equal to 0 cannot be deleted using delete by
6565query because `internal` versioning does not support 0 as a valid
@@ -70,18 +70,18 @@ requests sequentially to find all of the matching documents to delete. A bulk
7070delete request is performed for each batch of matching documents. If a
7171search or bulk request is rejected, the requests are retried up to 10 times, with
7272exponential back off. If the maximum retry limit is reached, processing halts
73- and all failed requests are returned in the response. Any delete requests that
74- completed successfully still stick, they are not rolled back.
73+ and all failed requests are returned in the response. Any delete requests that
74+ completed successfully still stick, they are not rolled back.
7575
76- You can opt to count version conflicts instead of halting and returning by
77- setting `conflicts` to `proceed`.
76+ You can opt to count version conflicts instead of halting and returning by
77+ setting `conflicts` to `proceed`.
7878
7979===== Refreshing shards
8080
8181Specifying the `refresh` parameter refreshes all shards involved in the delete
82- by query once the request completes. This is different than the delete API's
83- `refresh` parameter, which causes just the shard that received the delete
84- request to be refreshed. Unlike the delete API, it does not support
82+ by query once the request completes. This is different than the delete API's
83+ `refresh` parameter, which causes just the shard that received the delete
84+ request to be refreshed. Unlike the delete API, it does not support
8585`wait_for`.
8686
8787[[docs-delete-by-query-task-api]]
@@ -90,7 +90,7 @@ request to be refreshed. Unlike the delete API, it does not support
9090If the request contains `wait_for_completion=false`, {es}
9191performs some preflight checks, launches the request, and returns a
9292<<tasks,`task`>> you can use to cancel or get the status of the task. {es} creates a
93- record of this task as a document at `.tasks/task/${taskId}`. When you are
93+ record of this task as a document at `.tasks/task/${taskId}`. When you are
9494done with a task, you should delete the task document so {es} can reclaim the
9595space.
9696
@@ -101,20 +101,20 @@ before proceeding with the request. See <<index-wait-for-active-shards>>
101101for details. `timeout` controls how long each write request waits for unavailable
102102shards to become available. Both work exactly the way they work in the
103103<<docs-bulk,Bulk API>>. Delete by query uses scrolled searches, so you can also
104- specify the `scroll` parameter to control how long it keeps the search context
104+ specify the `scroll` parameter to control how long it keeps the search context
105105alive, for example `?scroll=10m`. The default is 5 minutes.
106106
107107===== Throttling delete requests
108108
109109To control the rate at which delete by query issues batches of delete operations,
110110you can set `requests_per_second` to any positive decimal number. This pads each
111- batch with a wait time to throttle the rate. Set `requests_per_second` to `-1`
111+ batch with a wait time to throttle the rate. Set `requests_per_second` to `-1`
112112to disable throttling.
113113
114- Throttling uses a wait time between batches so that the internal scroll requests
115- can be given a timeout that takes the request padding into account. The padding
116- time is the difference between the batch size divided by the
117- `requests_per_second` and the time spent writing. By default the batch size is
114+ Throttling uses a wait time between batches so that the internal scroll requests
115+ can be given a timeout that takes the request padding into account. The padding
116+ time is the difference between the batch size divided by the
117+ `requests_per_second` and the time spent writing. By default the batch size is
118118`1000`, so if `requests_per_second` is set to `500`:
119119
120120[source,txt]
@@ -123,9 +123,9 @@ target_time = 1000 / 500 per second = 2 seconds
123123wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
124124--------------------------------------------------
125125
126- Since the batch is issued as a single `_bulk` request, large batch sizes
127- cause {es} to create many requests and wait before starting the next set.
128- This is "bursty" instead of "smooth".
126+ Since the batch is issued as a single `_bulk` request, large batch sizes
127+ cause {es} to create many requests and wait before starting the next set.
128+ This is "bursty" instead of "smooth".
129129
130130[[docs-delete-by-query-slice]]
131131===== Slicing
@@ -134,11 +134,11 @@ Delete by query supports <<slice-scroll, sliced scroll>> to parallelize the
134134delete process. This can improve efficiency and provide a
135135convenient way to break the request down into smaller parts.
136136
137- Setting `slices` to `auto` chooses a reasonable number for most data streams and indices.
138- If you're slicing manually or otherwise tuning automatic slicing, keep in mind
137+ Setting `slices` to `auto` chooses a reasonable number for most data streams and indices.
138+ If you're slicing manually or otherwise tuning automatic slicing, keep in mind
139139that:
140140
141- * Query performance is most efficient when the number of `slices` is equal to
141+ * Query performance is most efficient when the number of `slices` is equal to
142142the number of shards in the index or backing index. If that number is large (for example,
143143500), choose a lower number as too many `slices` hurts performance. Setting
144144`slices` higher than the number of shards generally does not improve efficiency
@@ -171,25 +171,25 @@ Defaults to `true`.
171171include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyzer]
172172
173173include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyze_wildcard]
174-
174+
175175`conflicts`::
176- (Optional, string) What to do if delete by query hits version conflicts:
176+ (Optional, string) What to do if delete by query hits version conflicts:
177177 `abort` or `proceed`. Defaults to `abort`.
178178
179179include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=default_operator]
180180
181181include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=df]
182-
182+
183183include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
184184+
185185Defaults to `open`.
186186
187187include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=from]
188188
189189include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
190-
190+
191191include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=lenient]
192-
192+
193193include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=max_docs]
194194
195195include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=preference]
@@ -214,9 +214,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=scroll_size]
214214include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search_type]
215215
216216include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search_timeout]
217-
217+
218218include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=slices]
219-
219+
220220include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sort]
221221
222222include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source]
@@ -226,7 +226,7 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source_excludes]
226226include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source_includes]
227227
228228include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=stats]
229-
229+
230230include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=terminate_after]
231231
232232include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeout]
@@ -239,9 +239,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=wait_for_active_shards
239239==== {api-request-body-title}
240240
241241`query`::
242- (Optional, <<query-dsl,query object>>) Specifies the documents to delete
242+ (Optional, <<query-dsl,query object>>) Specifies the documents to delete
243243 using the <<query-dsl,Query DSL>>.
244-
244+
245245
246246[[docs-delete-by-query-api-response-body]]
247247==== Response body
@@ -345,7 +345,7 @@ this is non-empty then the request aborted because of those failures.
345345Delete by query is implemented using batches, and any failure causes the entire
346346process to abort but all failures in the current batch are collected into the
347347array. You can use the `conflicts` option to prevent reindex from aborting on
348- version conflicts.
348+ version conflicts.
349349
350350[[docs-delete-by-query-api-example]]
351351==== {api-examples-title}
@@ -377,7 +377,7 @@ POST /my-index-000001,my-index-000002/_delete_by_query
377377// TEST[s/^/PUT my-index-000001\nPUT my-index-000002\n/]
378378
379379Limit the delete by query operation to shards that a particular routing
380- value:
380+ value:
381381
382382[source,console]
383383--------------------------------------------------
@@ -571,7 +571,7 @@ though these are all taken at approximately the same time.
571571
572572The value of `requests_per_second` can be changed on a running delete by query
573573using the `_rethrottle` API. Rethrottling that speeds up the
574- query takes effect immediately but rethrotting that slows down the query
574+ query takes effect immediately but rethrotting that slows down the query
575575takes effect after completing the current batch to prevent scroll
576576timeouts.
577577
@@ -670,6 +670,6 @@ POST _tasks/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel
670670
671671The task ID can be found using the <<tasks,tasks API>>.
672672
673- Cancellation should happen quickly but might take a few seconds. The task status
674- API above will continue to list the delete by query task until this task checks that it
673+ Cancellation should happen quickly but might take a few seconds. The task status
674+ API above will continue to list the delete by query task until this task checks that it
675675has been cancelled and terminates itself.
0 commit comments