Skip to content

Commit a7e69b0

Browse files
committed
Docs: Document failures on reindex and friends
We already had *some* documentation of the batch nature of `reindex` and friends but it wasn't super obvious how it interacted with the `failures` element in the response. This adds some more documentation the `failures` element.
1 parent c08daf2 commit a7e69b0

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

docs/reference/docs/delete-by-query.asciidoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,12 @@ executed again in order to conform to `requests_per_second`.
284284

285285
`failures`::
286286

287-
Array of all indexing failures. If this is non-empty then the request aborted
288-
because of those failures. See `conflicts` for how to prevent version conflicts
289-
from aborting the operation.
287+
Array of failures if there were any unrecoverable errors during the process. If
288+
this is non-empty then the request aborted because of those failures.
289+
Delete-by-query is implemented using batches and any failure causes the entire
290+
process to abort but all failures in the current batch are collected into the
291+
array. You can use the `conflicts` option to prevent reindex from aborting on
292+
version conflicts.
290293

291294

292295
[float]

docs/reference/docs/reindex.asciidoc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ POST _reindex
161161

162162
`index` and `type` in `source` can both be lists, allowing you to copy from
163163
lots of sources in one request. This will copy documents from the `_doc` and
164-
`post` types in the `twitter` and `blog` index. The copied documents would include the
165-
`post` type in the `twitter` index and the `_doc` type in the `blog` index. For more
164+
`post` types in the `twitter` and `blog` index. The copied documents would include the
165+
`post` type in the `twitter` index and the `_doc` type in the `blog` index. For more
166166
specific parameters, you can use `query`.
167167

168-
The Reindex API makes no effort to handle ID collisions. For such issues, the target index
169-
will remain valid, but it's not easy to predict which document will survive because
168+
The Reindex API makes no effort to handle ID collisions. For such issues, the target index
169+
will remain valid, but it's not easy to predict which document will survive because
170170
the iteration order isn't well defined.
171171

172172
[source,js]
@@ -666,9 +666,11 @@ executed again in order to conform to `requests_per_second`.
666666

667667
`failures`::
668668

669-
Array of all indexing failures. If this is non-empty then the request aborted
670-
because of those failures. See `conflicts` for how to prevent version conflicts
671-
from aborting the operation.
669+
Array of failures if there were any unrecoverable errors during the process. If
670+
this is non-empty then the request aborted because of those failures. Reindex
671+
is implemented using batches and any failure causes the entire process to abort
672+
but all failures in the current batch are collected into the array. You can use
673+
the `conflicts` option to prevent reindex from aborting on version conflicts.
672674

673675
[float]
674676
[[docs-reindex-task-api]]
@@ -1004,7 +1006,7 @@ number for most indices. If slicing manually or otherwise tuning
10041006
automatic slicing, use these guidelines.
10051007

10061008
Query performance is most efficient when the number of `slices` is equal to the
1007-
number of shards in the index. If that number is large (e.g. 500),
1009+
number of shards in the index. If that number is large (e.g. 500),
10081010
choose a lower number as too many `slices` will hurt performance. Setting
10091011
`slices` higher than the number of shards generally does not improve efficiency
10101012
and adds overhead.
@@ -1018,7 +1020,7 @@ documents being reindexed and cluster resources.
10181020
[float]
10191021
=== Reindex daily indices
10201022

1021-
You can use `_reindex` in combination with <<modules-scripting-painless, Painless>>
1023+
You can use `_reindex` in combination with <<modules-scripting-painless, Painless>>
10221024
to reindex daily indices to apply a new template to the existing documents.
10231025

10241026
Assuming you have indices consisting of documents as follows:

docs/reference/docs/update-by-query.asciidoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,13 @@ executed again in order to conform to `requests_per_second`.
338338

339339
`failures`::
340340

341-
Array of all indexing failures. If this is non-empty then the request aborted
342-
because of those failures. See `conflicts` for how to prevent version conflicts
343-
from aborting the operation.
341+
Array of failures if there were any unrecoverable errors during the process. If
342+
this is non-empty then the request aborted because of those failures.
343+
Update-by-query is implemented using batches and any failure causes the entire
344+
process to abort but all failures in the current batch are collected into the
345+
array. You can use the `conflicts` option to prevent reindex from aborting on
346+
version conflicts.
347+
344348

345349

346350
[float]

0 commit comments

Comments
 (0)