Hi, I have a use case for sorting documents based on the sum of counts of values for an specific field, lets say i have a field rating
, and the search query gives 20 docs with rating:High
, and 30 with rating:Critical
, for a total of 50, then i have 10 with rating:High
and 5 with rating:Critical
, for a total of 15, the one with sum of 50 would go first and the one with sum 15 will go next if sort descending, i want to be able to sort search results using the sum of these value counts and do it ascending and descending depending on these counts.
Thanks