1

I currently have a document which gets revised regularly, I want to keep track of the document by keeping each old version of the document. So if document A has a summary and update date I want to, after every update, keep the previous version along with its update data.

The problem is that I'm not sure how I should do this efficiently:

...{
        Title: A
        Summary: {update_date:content, update_date:content, ...}
    }

The problem is that if I take the key as value then the automatic generated schema will take all dates as possible keys. Which is not something you want.

So my question is what's the most efficient way of tracking all revisions by date in ElasticSearch?

0

Elasticsearch stores data in on a document basis. Even if you are to put a slightly different data, each of the resulting document must be stored as a different document.

Note that the versioning in Elasticsearch is used for consistency, not for data tracking across different versions. That is, in short, only the latest version of a document is saved.

I think what you can do is to prepare a document for each separate version, and that's only thing you can do as long as you are using Elasticsearch.

{
    "Title": "A",
    "Summary": "CONTENT",
    "updated_date": "The date"
 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.