Hide a document from the searching

We want to use Elasticsearch as primary data source, and we also want to keep track of changes of document, so we want to store all the versions of a document.

As a solution will be to hide previous document versions from the index, is this possible?

I'd probably index the document twice:

  • One in the live index using the same _id always so updates will overwrite any existing document.
  • One in the historical index using id+timestamp as the _id so all versions will be kept.

Can you please advise why to use also timestamp in the _id?

Better idea. Don't set any id and let elasticsearch create one for you.

Ok, thanks.

Can you please also advise if it is possible to use a processor, or any other tool, to automatically add a new document in the historical index when a new documented is added in or updated in live index?

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