Automatic id generation on bulk create

Is it possible to have automatic id generation on bulk create?
What is the syntax? Leaving out the _id?

{ "create" : { "_index" : "test", "_type" : "type1"} }
{ "field1" : "value3" }

Yep, this should work.

On Fri, Oct 14, 2011 at 11:36 AM, michael michael.javaone@gmail.com wrote:

Is it possible to have automatic id generation on bulk create?
What is the syntax? Leaving out the _id?

{ "create" : { "_index" : "test", "_type" : "type1"} }
{ "field1" : "value3" }

Hello ,
I have a doubt at "index,type,id" for elastic search. I had a data and converted in json and seen code below like "index,type,id" of each&every data. How can I actually do it? I've checked some tutorials and could not understand.

Ex:{ "index" : { "index" : "pokedex", "type" : "pokemon", "_id" : "1" } }
{ "ndex": 1, "name": "Bulbasaur" }
{ "index" : { "index" : "pokedex", "type" : "pokemon", "_id" : "2" } }
{ "ndex": 2, "name": "Ivysaur" }
{ "index" : { "index" : "pokedex", "type" : "pokemon", "_id" : "3" } }
{ "ndex": 3, "name": "Venusaur"}

How did we take or automated this format like { "index" : { "index" : "pokedex", "type" : "pokemon", "_id" : "1" } }, here "id" will change everytime along with the data.
Thanks, advance.

Please open a new thread of your own rather than commenting on a thread that is 5 years old.