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
The endpoints are `/_bulk` and `/{index}/_bulk`. When the index is provided, it
176
-
will be used by default on bulk items that don't provide it explicitly.
177
-
178
-
A note on the format. The idea here is to make processing of this as
179
-
fast as possible. As some of the actions will be redirected to other
180
-
shards on other nodes, only `action_meta_data` is parsed on the
181
-
receiving node side.
182
-
183
-
Client libraries using this protocol should try and strive to do
184
-
something similar on the client side, and reduce buffering as much as
185
-
possible.
186
-
187
-
The response to a bulk action is a large JSON structure with the individual
188
-
results of each action that was performed in the same order as the actions that
189
-
appeared in the request. The failure of a single action does not affect the
190
-
remaining actions.
191
-
192
-
There is no "correct" number of actions to perform in a single bulk
193
-
call. You should experiment with different settings to find the optimum
194
-
size for your particular workload.
195
-
196
-
If using the HTTP API, make sure that the client does not send HTTP
197
-
chunks, as this will slow things down.
198
-
199
-
[float]
200
-
[[bulk-optimistic-concurrency-control]]
201
-
==== Optimistic Concurrency Control
202
-
203
-
Each `index` and `delete` action within a bulk API call may include the
204
-
`if_seq_no` and `if_primary_term` parameters in their respective action
205
-
and meta data lines. The `if_seq_no` and `if_primary_term` parameters control
206
-
how operations are executed, based on the last modification to existing
207
-
documents. See <<optimistic-concurrency-control>> for more details.
208
-
209
-
210
-
[float]
211
-
[[bulk-versioning]]
212
-
==== Versioning
213
-
214
-
Each bulk item can include the version value using the
215
-
`version` field. It automatically follows the behavior of the
216
-
index / delete operation based on the `_version` mapping. It also
217
-
support the `version_type` (see <<index-versioning, versioning>>).
218
-
219
-
[float]
220
-
[[bulk-routing]]
221
-
==== Routing
222
-
223
-
Each bulk item can include the routing value using the
224
-
`routing` field. It automatically follows the behavior of the
225
-
index / delete operation based on the `_routing` mapping.
226
-
227
-
[float]
228
-
[[bulk-wait-for-active-shards]]
229
-
==== Wait For Active Shards
230
-
231
-
When making bulk calls, you can set the `wait_for_active_shards`
232
-
parameter to require a minimum number of shard copies to be active
233
-
before starting to process the bulk request. See
234
-
<<index-wait-for-active-shards,here>> for further details and a usage
235
-
example.
236
-
237
-
[float]
238
-
[[bulk-refresh]]
239
-
==== Refresh
240
-
241
-
Control when the changes made by this request are visible to search. See
242
-
<<docs-refresh,refresh>>.
243
-
244
-
NOTE: Only the shards that receive the bulk request will be affected by
245
-
`refresh`. Imagine a `_bulk?refresh=wait_for` request with three
246
-
documents in it that happen to be routed to different shards in an index
247
-
with five shards. The request will only wait for those three shards to
248
-
refresh. The other two shards that make up the index do not
249
-
participate in the `_bulk` request at all.
250
-
251
323
[float]
252
324
[[bulk-update]]
253
-
==== Update
325
+
===== Bulk update example
254
326
255
327
When using the `update` action, `retry_on_conflict` can be used as a field in
256
328
the action itself (not in the extra payload line), to specify how many
@@ -278,13 +350,3 @@ POST _bulk
278
350
// CONSOLE
279
351
// TEST[continued]
280
352
281
-
[float]
282
-
[[bulk-security]]
283
-
==== Security
284
-
285
-
See <<url-access-control>>.
286
-
287
-
[float]
288
-
[[bulk-partial-responses]]
289
-
==== Partial responses
290
-
To ensure fast responses, the bulk API will respond with partial results if one or more shards fail. See <<shard-failures, Shard failures>> for more information.
0 commit comments