I have a question on storing different versions of a document in Elasticsearch, i.e. on document update we have to store the old version. We might not want to store all older versions, but at least multiple active versions of a document.
Is it possible to store versions/revisions in Elastic Search and how ?
These versions not be integers, They can be 1.0.1,1.0.2 etc
There's no built-in support for this. Which means that you need to manage this by yourself.
It could be by adding a version_date field within your document and using another _id for the next versions of the document. I'd recommend creating an _id using the functional id you want and append the timestamp in ms to it. Something like:
PUT /index/_doc/1-1688451697762
{
"id": 1,
"version": 1,
"foo": "bar"
}
PUT /index/_doc/1-1688451768431
{
"id": 1,
"version": 2,
"foo": "baz"
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.