Query with aggregation for every significant term


(Lukas Tilch) #1

Hello,

I have an index wich contains revisions for files.
a file can have multiple revisions, with their own description, user and date.
the structure is completely flat.

"_source": {
    "date": "date",
    "path": "somepath",
    "@timestamp": "time",
    "author": "Doe, John",
    "@version": "1",
    "host": "host",
    "name": "ducument.txt",
    "ID": "%{name}+%revision",
    "revision": "1.1"
  },

every revision has it's own ID. based on the document and revisionNo.

now the question.
is it possible to write a query wich returns only the newest revision for each "name"?

the response should contain every name but only once with the highest revision number.
that would be an aggregarion for every significant name.

or should i restructure the import to create nested fields?


(system) #2

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