I now need a to perform a search that just returns say the last 10 documents modified. in the index and I don't care about the content. Can anyone suggest how I'd do this query.
Although min & max should return a single item based on the order it doesn't. Even if I manage to get this working, I still cant find anything that will give me the SQL equivalent of Select top 10 ......
I managed to resolve this by removing the post_date property on the mapping, then using the following query. I was trying to map sort in the same way as the filter (on the node hierarchy) which was incorrect even though nothing complained:
GET myindex/_search?q=content:*&filter_path=hits.hits._source.path.real&sort=file.last_modified:desc&size=10
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.