Monta
Monta

Reputation: 1180

Does Elasticsearch reindex the documents automatically each time I update them

I have a social model where users can like photos.

My photo document looks like this :

{
"id" : ... //Indexed
"url": ...
"likes": .. //Not indexed
//Other properties
}

My question is, as long as a photo gets likes from other users I have to update my document. Does this update make elasticsearch automatically reindex it (knowing that the "likes" property is NOT indexed in my mapping) or it's done only if my indexed properties have changed?

My concern is performance here.

Upvotes: 2

Views: 1074

Answers (1)

mel
mel

Reputation: 2790

Document in elasticsearch are immutable. Updating a document is always a reindexing and it consist of the following steps:

  • Retrieve the JSON (that you want to reindex)
  • Change it
  • Delete the old document
  • Index a new document

Elasticsearch documentation

Upvotes: 1

Related Questions