You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification/_global/update_by_query/UpdateByQueryRequest.ts
+25-16Lines changed: 25 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,29 @@ import { Duration } from '@_types/Time'
58
58
* A bulk update request is performed for each batch of matching documents.
59
59
* Any query or update failures cause the update by query request to fail and the failures are shown in the response.
60
60
* Any update requests that completed successfully still stick, they are not rolled back.
61
+
*
62
+
* **Refreshing shards**
63
+
* Specifying the `refresh` parameter refreshes all shards once the request completes.
64
+
* This is different than the update API's `refresh` parameter, which causes just the shard
65
+
* that received the request to be refreshed. Unlike the update API, it does not support
66
+
* `wait_for`.
67
+
*
68
+
* **Running update by query asynchronously**
69
+
*
70
+
* If the request contains `wait_for_completion=false`, Elasticsearch
71
+
* performs some preflight checks, launches the request, and returns a
72
+
* [task](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks) you can use to cancel or get the status of the task.
73
+
* Elasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`.
74
+
*
75
+
* **Waiting for active shards**
76
+
*
77
+
* `wait_for_active_shards` controls how many copies of a shard must be active
78
+
* before proceeding with the request. See [`wait_for_active_shards`](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create#operation-create-wait_for_active_shards)
79
+
* for details. `timeout` controls how long each write request waits for unavailable
80
+
* shards to become available. Both work exactly the way they work in the
81
+
* [Bulk API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk). Update by query uses scrolled searches, so you can also
82
+
* specify the `scroll` parameter to control how long it keeps the search context
83
+
* alive, for example `?scroll=10m`. The default is 5 minutes.
61
84
*
62
85
* **Throttling update requests**
63
86
*
@@ -103,28 +126,14 @@ import { Duration } from '@_types/Time'
103
126
* * Update performance scales linearly across available resources with the number of slices.
104
127
*
105
128
* Whether query or update performance dominates the runtime depends on the documents being reindexed and cluster resources.
106
-
*
107
-
* **Update the document source**
108
-
*
109
-
* Update by query supports scripts to update the document source.
110
-
* As with the update API, you can set `ctx.op` to change the operation that is performed.
111
-
*
112
-
* Set `ctx.op = "noop"` if your script decides that it doesn't have to make any changes.
113
-
* The update by query operation skips updating the document and increments the `noop` counter.
114
-
*
115
-
* Set `ctx.op = "delete"` if your script decides that the document should be deleted.
116
-
* The update by query operation deletes the document and increments the `deleted` counter.
117
-
*
118
-
* Update by query supports only `index`, `noop`, and `delete`.
119
-
* Setting `ctx.op` to anything else is an error.
120
-
* Setting any other field in `ctx` is an error.
121
-
* This API enables you to only modify the source of matching documents; you cannot move them.
129
+
* Refer to the linked documentation for examples of how to update documents using the `_update_by_query` API:
0 commit comments