As we know when we update an existed document the Elasticsearch engine will reindex the document and mark the previous document deleted. But for the restful API, it's same. So I guess the ElasticSearch will analysis the document whether exist by the unique document ID and then update or index.
So my question is, we don't need to care the index or update functionality, because both restful API and Java Client are PUT
the same endpoint, Am I right?
The most difference for PUT
and POST
document in Elasticsearch :
POST
will create a new document with a new unique ID .
PUT
will update the current document without change ID .
so if your ID is important to you like for some context , you should use PUT to update a document to keep this ID .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.