I want to sort the search hits based on two criteria - (1) value of an
attribute, and (2) _score. The first criteria is such that if the attribute
has two values "open" and "closed", the search hits with value "open"
should be ranked above those with value "closed". What is the best way to
do this in ES?
One approach I tried was to invert the score for search hits with value
"closed" using a function_score query. Though this works, there are two
issues - (1) search hits with value "closed" are ranked in the reverse
order of their score, (2) this approach does not allow handling more than
two values of the attribute. Is there a better way to do this in ES?
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5221fb7b-25bc-4065-9500-ad7f3bf2655e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.