Bulk index or delete documents Beta
Performs multiple indexing or delete operations in a single API call. This reduces overhead and can greatly increase indexing speed.
Query parameters
-
pipeline string
ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to
_none
disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. -
refresh string
If
true
, Elasticsearch refreshes the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
do nothing with refreshes. Valid values:true
,false
,wait_for
.Values are
true
,false
, orwait_for
. -
routing string
Custom value used to route operations to a specific shard.
-
_source boolean | string | array[string]
true
orfalse
to return the_source
field or not, or a list of fields to return. -
_source_excludes string | array[string]
A comma-separated list of source fields to exclude from the response.
-
_source_includes string | array[string]
A comma-separated list of source fields to include in the response.
-
timeout string
Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
-
wait_for_active_shards number | string
The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (
number_of_replicas+1
). -
require_alias boolean
If
true
, the request’s actions must target an index alias.
curl \
-X PUT http://api.example.com/_bulk \
-H "Content-Type: application/json" \
-d '[{"":{"_id":"string","_index":"string","routing":"string","if_primary_term":42.0,"if_seq_no":42.0,"version":42.0,"version_type":"internal"}}]'