Get Last Document Stored based on the Unique Field Type

Hi,
I have the documents storing on elastic search every hour and have the index as (testing-2018-03-12) which has some fields.
How do I return only the last documents based on a field ?

Example:

Doc1:
User: Paul
age: 34
Hours Logged: 8
@timestamp: ****

Doc2:
User: Paul
age: 34
Hours Logged: 8.5
@timestamp: ****

Doc3:
User: Kim
age: 23
Hours Logged: 4
@timestamp: ****

Doc4:
User: Kim
age: 23
Hours Logged: 3
@timestamp: ****

How do I return the latest document for all the Users?

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