I have a question regarding to sorts, the scenario i have is following:
I m creating a list of sort on one field with different custom sorting scripts, so eventually it looks like:
sorts: [
script: {}, # sort 1 (Strict match)
script: {}, # sort 2 (prefix match)
script: {} # sort 3 (more loose condition match)
]
The goal i want to achieve is that 1 should be used if could be, otherwise fall back to sort2, sort3.
But what i seeing is that even the we have the exact match docs based on user's query, the order does not working as I expect, am i not doing it correctly/how should i achieve my goal?
@ddorian43 Please take a look, the sorting i want to achieve here is that based on doc's field 'a',
try exact match first, if not, fall back to prefix, if still not, back to last one
read how sort works on documentation. See nulls first/last and missing. Basically it sorts by 3 values together. So they are always sorted by script then script2 then script3.
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.