Desc Last Date Last Value
XXX 01.01.2013 100
YYY 05.01.2011 500
I need to get the documents with the most recent date for that desc so I
can pull the value off of it.
If aggregation can not give me the document would it be possible to give
the document id with the most recent date for that desc? And I could use an
id filter to get the documents.
It won't do this for you exactly but you can probably get close. An
aggregator like:
terms agg on desc:
stats agg on date:
This should give you min and max date for your top desc values. You could
then use that information to craft a query to get your most recent doc
back: and(desc:XXX, date:01.01.2013). There also might be other
approaches you can do as well. Have you looked into structuring your data
differently? Maybe overwrite/update existing docs with latest date and
value information so you don't have all these duplicates? Maybe use
parent/child or nested documents?
Desc Last Date Last Value
XXX 01.01.2013 100
YYY 05.01.2011 500
I need to get the documents with the most recent date for that desc so I
can pull the value off of it.
If aggregation can not give me the document would it be possible to give
the document id with the most recent date for that desc? And I could use an
id filter to get the documents.
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.