Reputation: 540
I'm actually starting a new project with elasticsearch, I never used this so I do a lot of research and I just need 1 answer :
How can I choose the ID of an object when I create it ? For example, when I create this object :
{
"title": "Facebook API Data PHP",
"category": "PHP",
"tags": [
"Facebook",
"API"
],
"test2": 3.5252156144514514521
}
The ID by default is something like this : AVxYqhmCnGpDth4S4vBA
And I want to set the ID when I create the object to something like that object_1
Upvotes: 0
Views: 44
Reputation: 7762
Pass the ID while indexing the data into Elasticsearch. Like
PUT indexName/typeName/object_1
{
"title": "Facebook API Data PHP",
"category": "PHP",
"tags": [
"Facebook",
"API"
],
"test2": 3.5252156144514514521
}
Upvotes: 1