Automatic document id generation in elasticSearch


(Balanjaneyulu Kantu) #1

Hi,
I was inserting the data as below.

PUT /employees/employee/1
{
"name":"Crescent School", "description":"State Board Affiliation", "street":"Tonk Road",
"city":"Jaipur", "state":"RJ", "zip":"176114","location":[26.8535922, 75.7923988],
"fees":2500, "tags":["Well equipped labs"], "rating":"4.5"
}

PUT /employees/employee/2
{
"name":"Crescent School", "description":"State Board Affiliation", "street":"Tonk Road",
"city":"Jaipur", "state":"RJ", "zip":"176114","location":[26.8535922, 75.7923988],
"fees":2500, "tags":["Well equipped labs"], "rating":"4.5"
}

I want the document id to be automatically generated when I insert a row into elastic search document. Is there a way to generate Automatci document id.

Thanks,
Balu


(Mark Walkom) #2

Just do PUT /employees/employee with the corresponding document.


(Balanjaneyulu Kantu) #3

Thank you warkolm. Issue resolved.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.