Whats different with 'index' and 'create' of Bulk API

Hi all,

I tried Bulk API from the document as

{ "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
{ "create" : { "_index" : "test", "_type" : "type1", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_type" : "type1", "_index" : "index1"} }
{ "doc" : {"field2" : "value2"} }

I set action.auto_create_index: false in config/elasticsearch.yml, but I don't understand whats different with 'index' and 'create', because both of them, which the response returns as :

"error" : "IndexMissingException[[test] missing]"

Some one can explain it?

Jason

You can't create an index in a bulk request, you need to do it externally cause you have action.auto_create_index: false.

Hi Mark,

Thanks.

If the index exists, whats different with 'create' and 'index'?

Jason

See here:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#operation-type

If you use create if a doc with that id already exists, if you use index it will create a document or update it if xisting.

Thanks you, its helpful