Consider the following document
{
"title": "My first blog entry",
"text": "Starting to get the hang of this...",
"tags": [ "testing" ],
"views": 0
}
I need to run kind of an upsert operation. If I encounter data like
{
"id": 1,
"tags": [ "new tag" ]
}
I want to update the existing document with same id. So result should be :
{
"id": 1,
"title": "My first blog entry",
"text": "Starting to get the hang of this...",
"tags": [ "testing", "new tag" ],
"views": 0
}
If the document with same id does not exist, I want to create a new one.
In Solr I could do this using Atomic updates. Is there a way to do this in Elasticsearch using Bulk API in Java?