I try to get a list of documents ordered by a field. No specific limit or
offset used. Just a search with a sort.
The returned documents are just sorted "by shards". In other words, the
first 3 documents are sorted right, then the 4th is not well sorted but the
10 following are well sorted comparing to the 4th...
I understand that each shard returns a sorted result set. Right ?
But I thought that the search_type could change this behavior and apply the
sort after having fetched documents.
You get proper sorted results when you use query_then_fetch (across all top
"size" results), if you use query_and_fetch, then each shard return the size
requested hits, and then they are sorted between them.
I try to get a list of documents ordered by a field. No specific limit or
offset used. Just a search with a sort.
The returned documents are just sorted "by shards". In other words, the
first 3 documents are sorted right, then the 4th is not well sorted but the
10 following are well sorted comparing to the 4th...
I understand that each shard returns a sorted result set. Right ?
But I thought that the search_type could change this behavior and apply the
sort after having fetched documents.
My issue is related to nested fields (again sorry). I got this strange
behavior each time a use a sort pattern like "path1.path2.sortedField".
Everything is working fine when sorting fields are attached directly to the
root document.
Forget my last comment please...It's monday morning. I wanted to index
integer but the field was indexed as a string...
Thanks again for your help (and your patience).
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.