0

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

1 Answer 1

1

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  
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.