Hey guys,
This might be a basic query but cannot figure it out.
Among the documents of a certain time window, I like to find the last one (by time) which matches by given field(s).
Any ideas?
FYI, I'm using the latest ES.
Thanks!
Ray
Hey guys,
This might be a basic query but cannot figure it out.
Among the documents of a certain time window, I like to find the last one (by time) which matches by given field(s).
Any ideas?
FYI, I'm using the latest ES.
Thanks!
Ray
You could just sort the data and you would then know the first or last document of all the documents returned is the one you want. You could even set your fetch size to 1 and you would only ever get the document you wanted.
sort of a good example
Awesome! That's what exactly I was looking for.
Thanks Ed!
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.