Update Document Questions


(Jon Becker) #1

Hello,
Regarding updating documents via Elasticsearch's bulk API, how are documents compared? As far as I know, for the "Create" action type the index will fail if index and type exists, and for the "Index" action type the index is deleted then reindexed. Are these documents compared by index name and ID, or is the entire document compared using a hash function or something similar? Is the same comparisons used for update/partial update APIs?
If it is a hash function to compare documents, do the meta-fields factor in the equation?

Thanks!


(David Pilato) #2

how are documents compared?

By the _id.


(Jon Becker) #3

Hey David, simple enough :slight_smile:. Looking over the code in InternalEngine.java in particular around the update functionality. It appears the only time we wouldn't call Lucene's updatedocument is if there is a version conflict between documents or if autogenerated IDs are used, correct? If I wanted to reduce the number of "deleted" documents in Lucene/avoid reindexing existing document which don't contain changes, does Elastic provide any functionality other than the force merge API?


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.