I've been trying to break results up into two groups:
- those with a score over 0.5
- those with a score under 0.5
and then sort each of these sections by date, descending.
I've tried multiple approaches, but can't seem to find the right syntax.
Can anyone point me in the right direction?
"sort": [
"_score",
{ "date": { "order": "desc" } }
]
In Perl, I'd sort something like this (untested pseudo code):
sort { $a->{score}>0.5 <=> $b->{score}>0.5 || $a->{date} cmp $b->{date} }
How would I do something similar in elasticsearch?
--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.