Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate REST access to System Indices #60945

Merged
merged 195 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from 120 commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
a1ffb91
first cut of header-based system index enforcement
gwbrown Jul 29, 2020
4712c47
Properly shut down components in test
gwbrown Jul 30, 2020
6793e2e
Version guard system index flag on cleanup
gwbrown Jul 30, 2020
98cad26
Fix guard in REST layer
gwbrown Aug 3, 2020
3fe1011
Set origin from Enrich
gwbrown Aug 4, 2020
1c67a6f
Set origin from Enrich in the processor
gwbrown Aug 4, 2020
57b8c03
Fix NPEs in Enrich tests
gwbrown Aug 4, 2020
fc85715
Ensure we never double-add the header (should be tests only?)
gwbrown Aug 4, 2020
d782a40
Fix NPE in UsageServiceTests
gwbrown Aug 4, 2020
b437ad6
Fix NPE in RestAnalyzeActionTests
gwbrown Aug 4, 2020
d0c1a8f
Fix NPE in RestBulkActionTests
gwbrown Aug 4, 2020
ebaafcf
Fix NPE/mocking in `RestActionTestCase`s
gwbrown Aug 4, 2020
05f8fa1
Add `allow_system_index_access` flag to search spec
gwbrown Aug 10, 2020
606d9c9
Add `allow_system_index_access` as necessary to Watcher tests
gwbrown Aug 10, 2020
d74939b
Add `allow_system_index_access` flag to count, index, index.delete specs
gwbrown Aug 10, 2020
2122240
Add `allow_system_index_access` to ML REST tests as necessary
gwbrown Aug 10, 2020
a618ec1
Allow REST handlers to control whether they allow system index access
gwbrown Aug 10, 2020
842e3ef
Fix NPE/client mock in RestSearchScrollActionTests
gwbrown Aug 10, 2020
d2acd60
Fix NPE/client mock in RestClearScrollActionTests
gwbrown Aug 10, 2020
04eb2fa
Add allow_system_index_access flag to Get API
gwbrown Aug 11, 2020
a7ea769
Add allow_system_index_access flag to Security tests as necessary
gwbrown Aug 11, 2020
05b80ab
Add allow_system_index_access flag to upgrade tests as necessary
gwbrown Aug 11, 2020
ce93851
Include system indices in cluster health by default
gwbrown Aug 11, 2020
fc88e41
Fix NPE/client mock in SecurityBaseRestHandlerTests
gwbrown Aug 11, 2020
f744cd5
Fix NPE/client mock in RestHasPrivilegesActionTests
gwbrown Aug 11, 2020
853d874
Add allow_system_index_access flag to ML Restart tests as necessary
gwbrown Aug 11, 2020
391f132
Add allow_system_index_access flag to cluster restart tests as necessary
gwbrown Aug 11, 2020
2fdc53e
Add allow_system_index_access flag to Transform tests as necessary
gwbrown Aug 11, 2020
01b1fb3
Clean up old comments
gwbrown Aug 11, 2020
58d651f
Merge branch 'master' into si/protection-header
gwbrown Aug 11, 2020
612c304
Allow Kibana APIs to access system indices by default.
gwbrown Aug 11, 2020
6879de8
Fix NPE/client mock in RestGetUserPrivilegesActionTests
gwbrown Aug 11, 2020
3924661
Rename and centralize system index access control header key
gwbrown Aug 11, 2020
8e5b29e
Merge branch 'master' into si/protection-header
gwbrown Aug 11, 2020
19147b7
Add allow_system_index_access flag to Transform Upgrade tests as nece…
gwbrown Aug 11, 2020
b80f516
Add allow_system_index_access flag to relevant REST specs
gwbrown Aug 12, 2020
71da5f8
ClusterModule now requires a ThreadContext instead of a ThreadPool
gwbrown Aug 12, 2020
9e5b251
Remove unnecessary null check in IndexNameExpressionResolver
gwbrown Aug 12, 2020
b4128e7
s/Boolean.parseBoolean/Booleans.parseBoolean
gwbrown Aug 12, 2020
948e2bc
Remove accidental double space per review
gwbrown Aug 12, 2020
0bc64f6
Ensure method is actually called in RestBulkActionTests
gwbrown Aug 12, 2020
8d97b0f
Move allow_system key to constant & add version constant
gwbrown Aug 12, 2020
e16b6dc
Refactor ThreadContext header to use positive logic
gwbrown Aug 12, 2020
ed19899
Merge branch 'master' into si/protection-header
gwbrown Aug 12, 2020
3e979d9
Fix test after inverting header logic
gwbrown Aug 12, 2020
4a81438
Fix logic when attaching header
gwbrown Aug 13, 2020
be71f26
Merge branch 'master' into si/protection-header
gwbrown Aug 13, 2020
766e7dd
Merge branch 'master' into si/protection-header
gwbrown Aug 14, 2020
f091c91
Merge branch 'master' into si/protection-header
gwbrown Aug 17, 2020
e708dcf
Fix compilation from merge
gwbrown Aug 17, 2020
c8588cc
Add `allow_system_index_access` flag to test
gwbrown Aug 17, 2020
5325e0a
Remove unnecessary comment
gwbrown Aug 17, 2020
f69bc2b
INER tests for total wildcards
gwbrown Aug 17, 2020
5852572
Add dedicated system index blocking/access integration test
gwbrown Aug 17, 2020
8cadfca
Rules for aliases & system indices + unit tests
gwbrown Aug 17, 2020
c962c24
Clean up system index upgrade tests
gwbrown Aug 18, 2020
1314cfd
Add allow_system_index_access flag to docs as necessary & docs updates
gwbrown Aug 18, 2020
f0a9b68
Add allow_no_indices to upgrade tests to ensure they fail if appropriate
gwbrown Aug 18, 2020
c2f21d2
Ensure we throw a 404 if a system index is explicitly requested, but …
gwbrown Aug 18, 2020
a17155c
Upgrade tests for alias logic
gwbrown Aug 18, 2020
5307a69
Merge branch 'master' into si/protection-header
gwbrown Aug 18, 2020
8d4f90c
Fix BWC tests to account for both upgrades from 7.x and current
gwbrown Aug 18, 2020
c742d4a
Rename constants to be clearer
gwbrown Aug 18, 2020
d16ba0e
Move constants & default access config to `RestHandler` (from `BaseRe…
gwbrown Aug 18, 2020
159b40a
Move header attachment to `RestController#dispatchRequest` (from `Bas…
gwbrown Aug 18, 2020
a30107f
Merge branch 'master' into si/protection-header
gwbrown Aug 19, 2020
9b07888
Use the correct ThreadContext in RestController
gwbrown Aug 19, 2020
46854ab
Javadoc per review
gwbrown Aug 19, 2020
30225b3
Ensure allowSystemIndexAccessByDefault is passed through SecurityRest…
gwbrown Aug 20, 2020
0bf65e4
Switch to emitting a deprecation warning instead of changing behavior
gwbrown Aug 20, 2020
89f3925
Merge branch 'master' into si/protection-header
gwbrown Aug 20, 2020
dbe52f4
Merge branch 'master' into si/protection-header
gwbrown Aug 25, 2020
515b4eb
Correct NoOpNodeClient for changes in NodeClient
gwbrown Aug 25, 2020
912f096
Merge branch 'master' into si/protection-header
gwbrown Aug 26, 2020
39538e3
Implement "feature flag" for choosing system index access behavior
gwbrown Aug 27, 2020
e75c50f
Docs changes per review
gwbrown Aug 27, 2020
06c7ca4
Formatting changes per review
gwbrown Aug 27, 2020
966cfc3
allow_system_index_access flag in YAML tests as necessary
gwbrown Aug 27, 2020
d25c10d
Allow system index access in GetAliases, as disallowing it causes ver…
gwbrown Aug 27, 2020
a0a78f8
Allow system index access in GetDataStreamsStats, as disallowing it c…
gwbrown Aug 27, 2020
cba4fd7
Allow system index access in cat APIs, otherwise we get deprecation w…
gwbrown Aug 27, 2020
a3980e3
Remove allow_system flag from test that no longer needs it due to cha…
gwbrown Aug 28, 2020
7770cb6
Remove allow_system flag from more tests that no longer needs it due …
gwbrown Aug 28, 2020
a22258a
Merge branch 'master' into si/protection-header
gwbrown Aug 31, 2020
56d4d05
Add allow_system_index_access to docs tests where necessary
gwbrown Aug 31, 2020
15ef7e8
Fix origin setting in Enrich classes
gwbrown Aug 31, 2020
8e7d9c1
Add allow_system_index_access to reindex tests as necessary
gwbrown Sep 1, 2020
712f1cc
Add allow_system_index_access to Watcher tests & test cleanup as nece…
gwbrown Sep 1, 2020
37dc6df
Add allow_system_index_access to Monitoring test cleanup as necessary
gwbrown Sep 1, 2020
ef3e9cd
Add allow_system_index_access to Transform test cleanup as necessary
gwbrown Sep 1, 2020
a2dcb91
Merge branch 'master' into si/protection-header
gwbrown Sep 8, 2020
83c2c52
add allow_system_index_access to Watcher cleanup
gwbrown Sep 8, 2020
555910c
Remove now unnecessary allow_system_index_access from upgrade test
gwbrown Sep 8, 2020
5e484f1
Add allow_system_index_access to ML tests as necessary
gwbrown Sep 8, 2020
10c3886
Another allow_system_index_access test fix
gwbrown Sep 8, 2020
d20847b
Remove allow_system_index_access from TransformSurvivesUpgradeIT
gwbrown Sep 8, 2020
1c579bc
Add allow_system_index_access as necessary in MlMappingsUpgradeIT
gwbrown Sep 8, 2020
bd4caf0
Ensure system index access is allowed for GetAliasesAction even if th…
gwbrown Sep 8, 2020
dd6c770
Merge branch 'master' into si/protection-header
gwbrown Sep 9, 2020
773272e
Drop response headers during SQL index resolution to prevent deprecat…
gwbrown Sep 9, 2020
2beeb31
Drop response headers during Enrich reindex to prevent deprecation wa…
gwbrown Sep 10, 2020
df0a9b2
Merge branch 'master' into si/protection-header
gwbrown Sep 10, 2020
646dd12
Fix compilation error due to merge
gwbrown Sep 10, 2020
676d0e3
Merge branch 'master' into si/protection-header
gwbrown Sep 10, 2020
02cf28e
ThreadPool -> ThreadContext in test per review
gwbrown Sep 10, 2020
c405757
Formatting per review
gwbrown Sep 10, 2020
0be7d2b
Add comment on enrich hack
gwbrown Sep 10, 2020
56faa3f
Merge branch 'master' into si/protection-header
gwbrown Sep 14, 2020
828879c
Expect deprecation warnings in ML upgrade tests
gwbrown Sep 14, 2020
e5f9067
Merge branch 'master' into si/protection-header
gwbrown Sep 14, 2020
ba55f39
Wording change per review
gwbrown Sep 15, 2020
a67c2b2
Update comment per review
gwbrown Sep 15, 2020
4c8763b
Factor out shared stream/map code per review
gwbrown Sep 15, 2020
fcd6af9
Break up large INER test cases per review
gwbrown Sep 15, 2020
c3bedf6
Tweak method name
gwbrown Sep 15, 2020
70a8114
Actually pass parameter in ML upgrade tests per review
gwbrown Sep 15, 2020
a621a3e
Break up IndexAbstractionTests per review
gwbrown Sep 15, 2020
89df7c8
Merge branch 'master' into si/protection-header
gwbrown Sep 15, 2020
0cf4411
Add origin for Logstash management APIs
gwbrown Sep 15, 2020
97bde46
Always allow system indiex warnings in ML index template tests
gwbrown Sep 15, 2020
240a6f0
Use test assumptions instead of setting system properties per review
gwbrown Sep 16, 2020
d38d150
Merge branch 'master' into si/protection-header
gwbrown Sep 16, 2020
46b646d
Merge branch 'master' into si/protection-header
gwbrown Sep 17, 2020
1972b9f
Merge branch 'master' into si/protection-header
gwbrown Sep 18, 2020
8fd1e26
Do not emit deprecation warnings on total wildcard queries
gwbrown Sep 18, 2020
9459027
Remove system index access by default from APIs which no longer need it
gwbrown Sep 18, 2020
8e990ec
First cut of security integration for _all handling
gwbrown Sep 18, 2020
24682c2
Add yet another allow_system_index_access flag as necessary
gwbrown Sep 18, 2020
3218750
Add yet more allow_system_index_access flag as necessary
gwbrown Sep 18, 2020
50a013c
Check if a deprecation warning should be emitted rather than allowing…
gwbrown Sep 21, 2020
c8d55a5
Remove header drop from IndexResolver
gwbrown Sep 21, 2020
9c15ae8
Set original indices header OUTSIDE of the context preserving listener
gwbrown Sep 21, 2020
6b2db2f
Merge branch 'master' into si/protection-header
gwbrown Sep 21, 2020
dfb6c78
Line lengths
gwbrown Sep 21, 2020
e767311
Merge branch 'master' into si/protection-header
gwbrown Sep 22, 2020
2d17229
Merge branch 'master' into si/protection-header
gwbrown Sep 23, 2020
9f7790f
Replace allow_system_index_access flags in Java tests with warnings h…
gwbrown Sep 23, 2020
08c2ec9
Replace allow_system_index_access flags in yaml tests with warnings h…
gwbrown Sep 24, 2020
7a2606f
Merge branch 'master' into si/protection-header
gwbrown Sep 24, 2020
bb27000
Remove a couple unnecessary warning checks (they might be back later)
gwbrown Sep 24, 2020
e3c4d81
The current security index is `.security-7`, not just ``.security`
gwbrown Sep 24, 2020
3ac9ecf
Fix skip:feature block in YAML test
gwbrown Sep 24, 2020
d3f5cd5
Add missing warning handler for current version
gwbrown Sep 24, 2020
3668a7b
Undo _all special case handling
gwbrown Sep 24, 2020
acc455a
Remove allow_system_index_access flag
gwbrown Sep 24, 2020
aa48e20
More `.security` -> `.security-7` in expected warnings
gwbrown Sep 24, 2020
f2520dc
Merge branch 'master' into si/protection-header
gwbrown Sep 24, 2020
04b7e4b
Unused import
gwbrown Sep 24, 2020
e9d5332
Work around _all resolution in Get Aliases API
gwbrown Sep 30, 2020
51e4d50
Specify index in "Test wildcard job id" so we don't get a warning
gwbrown Sep 30, 2020
661ce27
Accept warning in SQL test that might trigger it
gwbrown Sep 30, 2020
5c07fea
Allow system index access in APIs we're confident we want it
gwbrown Sep 30, 2020
dad9bd1
Merge branch 'master' into si/protection-header
gwbrown Sep 30, 2020
7013691
Spotless
gwbrown Sep 30, 2020
a5f080e
Merge branch 'master' into si/protection-header
gwbrown Oct 1, 2020
2e138fd
Respect system index access header when re-adding deprecation in Get …
gwbrown Oct 1, 2020
df094c3
Handle Get Alias deprecation warning in upgrade test
gwbrown Oct 1, 2020
2cb62db
Allow data streams stats action to only resolve to data streams
gwbrown Oct 1, 2020
e4f9d86
Merge branch 'master' into si/protection-header
gwbrown Oct 1, 2020
a00a0c7
Allow deprecation warning on another alias call
gwbrown Oct 1, 2020
aaa9759
Allow _cat/aliases to access system indices by default because it's w…
gwbrown Oct 1, 2020
1f989c7
Allow deprecation warning on wildcard Get Aliases call in MlJobIT
gwbrown Oct 1, 2020
cae36a5
Remove unnecessary semicolon
gwbrown Oct 1, 2020
7cb23dd
Merge branch 'master' into si/protection-header
gwbrown Oct 2, 2020
0eb283c
Fix compilation after merge
gwbrown Oct 2, 2020
0e302e6
Remove "feature flag" for deprecation warnings
gwbrown Oct 2, 2020
07aacba
Merge branch 'master' into si/protection-header
gwbrown Oct 5, 2020
5df4c3f
Refresh no longer allow system index access by default
gwbrown Oct 5, 2020
0eb3eb8
Remove unnecessary log line
gwbrown Oct 5, 2020
591b442
Don't create a new threadcontext, we already have one
gwbrown Oct 5, 2020
906e024
Don't need to take ThreadContext as a param in dispatchRequest
gwbrown Oct 5, 2020
e23a25b
Javadoc for isSystemIndexAccessAllowed
gwbrown Oct 5, 2020
b924de5
Deprecation logger doesn't need to be public
gwbrown Oct 5, 2020
d3eb247
Doc fix per review
gwbrown Oct 5, 2020
c223029
Allow deprecation warning for refreshing all indices
gwbrown Oct 5, 2020
ebabb5a
Allow warnings on refresh in reindex YAML tests
gwbrown Oct 5, 2020
d7b0f8e
Properly populate client in RestControllerTests now that it's actuall…
gwbrown Oct 5, 2020
45cf15d
Stash context in RestSubmitAsyncSearchActionTests so the same headers…
gwbrown Oct 5, 2020
49bf8c5
Handle more _refresh warnings
gwbrown Oct 5, 2020
18b98ce
YAML skip: features: warnings block
gwbrown Oct 5, 2020
2a6bbb2
Address _refresh warnings in yaml tests
gwbrown Oct 5, 2020
5c92e96
Warn when accessing aliases with names reserved for system indices
gwbrown Oct 5, 2020
c852f30
Suppress warnings when `X-elastic-product-origin` header is present
gwbrown Oct 5, 2020
5276b12
Merge branch 'master' into si/protection-header
gwbrown Oct 5, 2020
833215a
EMPTY_MAP -> emptyMap()
gwbrown Oct 5, 2020
f7c9e5b
Invert incorrect header check
gwbrown Oct 5, 2020
c4e5ed8
Add comment about header
gwbrown Oct 5, 2020
9d5dc5f
YAML syntax is THE WORST
gwbrown Oct 5, 2020
5211807
More specifying _refresh more closely in YAML tests
gwbrown Oct 5, 2020
1e4223b
Yet another _refresh call with a warning
gwbrown Oct 5, 2020
4e6c6d2
Fix a couple _refresh calls that got mixed up
gwbrown Oct 5, 2020
b9342bb
Even more _refresh index specifying
gwbrown Oct 6, 2020
0ea0be5
Another _refresh that sparks a warning
gwbrown Oct 6, 2020
dac5c74
Review feedback
gwbrown Oct 6, 2020
a014f0f
Merge branch 'master' into si/protection-header
gwbrown Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/reference/api-conventions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]

The defaults settings for the above parameters depend on the API being used.

Some indices (hereafter "system indices") are used by various system
modules and/or plugins to store state or configuration. These indices
are not intended to be accessed directly, and accessing them directly is
deprecated. In the next major version, access to these indices will be prevented
by default to prevent accidental operations. You can opt in to access to these
indices by using the following query string parameter:

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-system-index-access]

Using this parameter will prevent deprecation warnings in the current version,
and maintain the current behavior with deprecation warnings in the next major
version.

Some multi-target APIs that can target indices also support the following query
string parameter:

Expand Down
80 changes: 43 additions & 37 deletions docs/reference/docs/delete-by-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ POST /my-index-000001/_delete_by_query
==== {api-description-title}

You can specify the query criteria in the request URI or the request body
using the same syntax as the <<search-search,Search API>>.
using the same syntax as the <<search-search,Search API>>.

When you submit a delete by query request, {es} gets a snapshot of the data stream or index
when it begins processing the request and deletes matching documents using
`internal` versioning. If a document changes between the time that the
snapshot is taken and the delete operation is processed, it results in a version
conflict and the delete operation fails.
conflict and the delete operation fails.

NOTE: Documents with a version equal to 0 cannot be deleted using delete by
query because `internal` versioning does not support 0 as a valid
Expand All @@ -70,18 +70,18 @@ requests sequentially to find all of the matching documents to delete. A bulk
delete request is performed for each batch of matching documents. If a
search or bulk request is rejected, the requests are retried up to 10 times, with
exponential back off. If the maximum retry limit is reached, processing halts
and all failed requests are returned in the response. Any delete requests that
completed successfully still stick, they are not rolled back.
and all failed requests are returned in the response. Any delete requests that
completed successfully still stick, they are not rolled back.

You can opt to count version conflicts instead of halting and returning by
setting `conflicts` to `proceed`.
You can opt to count version conflicts instead of halting and returning by
setting `conflicts` to `proceed`.

===== Refreshing shards

Specifying the `refresh` parameter refreshes all shards involved in the delete
by query once the request completes. This is different than the delete API's
`refresh` parameter, which causes just the shard that received the delete
request to be refreshed. Unlike the delete API, it does not support
by query once the request completes. This is different than the delete API's
`refresh` parameter, which causes just the shard that received the delete
request to be refreshed. Unlike the delete API, it does not support
`wait_for`.

[[docs-delete-by-query-task-api]]
Expand All @@ -90,7 +90,7 @@ request to be refreshed. Unlike the delete API, it does not support
If the request contains `wait_for_completion=false`, {es}
performs some preflight checks, launches the request, and returns a
<<tasks,`task`>> you can use to cancel or get the status of the task. {es} creates a
record of this task as a document at `.tasks/task/${taskId}`. When you are
record of this task as a document at `.tasks/task/${taskId}`. When you are
done with a task, you should delete the task document so {es} can reclaim the
space.

Expand All @@ -101,20 +101,20 @@ before proceeding with the request. See <<index-wait-for-active-shards>>
for details. `timeout` controls how long each write request waits for unavailable
shards to become available. Both work exactly the way they work in the
<<docs-bulk,Bulk API>>. Delete by query uses scrolled searches, so you can also
specify the `scroll` parameter to control how long it keeps the search context
specify the `scroll` parameter to control how long it keeps the search context
alive, for example `?scroll=10m`. The default is 5 minutes.

===== Throttling delete requests

To control the rate at which delete by query issues batches of delete operations,
you can set `requests_per_second` to any positive decimal number. This pads each
batch with a wait time to throttle the rate. Set `requests_per_second` to `-1`
batch with a wait time to throttle the rate. Set `requests_per_second` to `-1`
to disable throttling.

Throttling uses a wait time between batches so that the internal scroll requests
can be given a timeout that takes the request padding into account. The padding
time is the difference between the batch size divided by the
`requests_per_second` and the time spent writing. By default the batch size is
Throttling uses a wait time between batches so that the internal scroll requests
can be given a timeout that takes the request padding into account. The padding
time is the difference between the batch size divided by the
`requests_per_second` and the time spent writing. By default the batch size is
`1000`, so if `requests_per_second` is set to `500`:

[source,txt]
Expand All @@ -123,9 +123,9 @@ target_time = 1000 / 500 per second = 2 seconds
wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
--------------------------------------------------

Since the batch is issued as a single `_bulk` request, large batch sizes
cause {es} to create many requests and wait before starting the next set.
This is "bursty" instead of "smooth".
Since the batch is issued as a single `_bulk` request, large batch sizes
cause {es} to create many requests and wait before starting the next set.
This is "bursty" instead of "smooth".

[[docs-delete-by-query-slice]]
===== Slicing
Expand All @@ -134,11 +134,11 @@ Delete by query supports <<slice-scroll, sliced scroll>> to parallelize the
delete process. This can improve efficiency and provide a
convenient way to break the request down into smaller parts.

Setting `slices` to `auto` chooses a reasonable number for most data streams and indices.
If you're slicing manually or otherwise tuning automatic slicing, keep in mind
Setting `slices` to `auto` chooses a reasonable number for most data streams and indices.
If you're slicing manually or otherwise tuning automatic slicing, keep in mind
that:

* Query performance is most efficient when the number of `slices` is equal to
* Query performance is most efficient when the number of `slices` is equal to
the number of shards in the index or backing index. If that number is large (for example,
500), choose a lower number as too many `slices` hurts performance. Setting
`slices` higher than the number of shards generally does not improve efficiency
Expand Down Expand Up @@ -171,25 +171,31 @@ Defaults to `true`.
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyzer]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=analyze_wildcard]

`conflicts`::
(Optional, string) What to do if delete by query hits version conflicts:
(Optional, string) What to do if delete by query hits version conflicts:
`abort` or `proceed`. Defaults to `abort`.

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=default_operator]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=df]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
+
Defaults to `open`.

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-system-index-access]
+
--
Defaults to `false`.
--

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=from]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=lenient]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=max_docs]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=preference]
Expand All @@ -214,9 +220,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=scroll_size]
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search_type]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search_timeout]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=slices]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=sort]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source]
Expand All @@ -226,7 +232,7 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source_excludes]
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=source_includes]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=stats]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=terminate_after]

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeout]
Expand All @@ -239,9 +245,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=wait_for_active_shards
==== {api-request-body-title}

`query`::
(Optional, <<query-dsl,query object>>) Specifies the documents to delete
(Optional, <<query-dsl,query object>>) Specifies the documents to delete
using the <<query-dsl,Query DSL>>.


[[docs-delete-by-query-api-response-body]]
==== Response body
Expand Down Expand Up @@ -345,7 +351,7 @@ this is non-empty then the request aborted because of those failures.
Delete by query is implemented using batches, and any failure causes the entire
process to abort but all failures in the current batch are collected into the
array. You can use the `conflicts` option to prevent reindex from aborting on
version conflicts.
version conflicts.

[[docs-delete-by-query-api-example]]
==== {api-examples-title}
Expand Down Expand Up @@ -377,7 +383,7 @@ POST /my-index-000001,my-index-000002/_delete_by_query
// TEST[s/^/PUT my-index-000001\nPUT my-index-000002\n/]

Limit the delete by query operation to shards that a particular routing
value:
value:

[source,console]
--------------------------------------------------
Expand Down Expand Up @@ -571,7 +577,7 @@ though these are all taken at approximately the same time.

The value of `requests_per_second` can be changed on a running delete by query
using the `_rethrottle` API. Rethrottling that speeds up the
query takes effect immediately but rethrotting that slows down the query
query takes effect immediately but rethrotting that slows down the query
takes effect after completing the current batch to prevent scroll
timeouts.

Expand Down Expand Up @@ -670,6 +676,6 @@ POST _tasks/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel

The task ID can be found using the <<tasks,tasks API>>.

Cancellation should happen quickly but might take a few seconds. The task status
API above will continue to list the delete by query task until this task checks that it
Cancellation should happen quickly but might take a few seconds. The task status
API above will continue to list the delete by query task until this task checks that it
has been cancelled and terminates itself.
Loading