We store bibliographic metadata in ES and it's working fine. However, due
to our update process, we store multiple documents per book - basically we
add a new document with a custom timestamp every time something gets
updated (outside ES).
Is there a way to perform queries, but restrict the searched set of
documents only to the latest version?
To illustrate it a bit more: E.g. we have a field that represent the ISBN -
which is semantically unique. Now there are like e.g. three documents with
this ISBN but with different timestamps (representing some change in the
associated metadata). What we would like to do is to restrict the actual
search (or filter or any operation you would normally perform) to the
document with latest timestamp.
I looked into scripting and scripting filters, but it seems, that the
scripting filter operates on a single document, so that I can't say
something like: for each match, throw out all documents but the one with
the maximum timestamp.