Is it possible to do a bulk index without specifying a document ID? I want Elasticsearch to generate a random ID for me while indexing, but can it be done?
Bulk: indexing multiple documentsedit Bulk requests allow sending multiple document-related operations to Elasticsearch in one request.
Upserts are "Update or Insert" operations. This means an upsert attempts to run your update script, but if the document does not exist (or the field you are trying to update doesn't exist), default values are inserted instead.
In Elasticsearch, an index (plural: indices) contains a schema and can have one or more shards and replicas. An Elasticsearch index is divided into shards and each shard is an instance of a Lucene index. Indices are used to store the documents in dedicated data structures corresponding to the data type of fields.
Yes you can!
Tested on 0.90.0.Beta1:
$ cat requests
{ "index" : { "_index" : "test", "_type" : "type1" } }
{ "field1" : "value1" }
$ curl -s -XPOST localhost:9200/_bulk --data-binary @requests; echo
{"took":6,"items":[{"create":{"_index":"test","_type":"type1","_id":"IWqsRqyhRVq-F69OLIngTA","_version":1,"ok":true}}]}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With