Ability to perform Nested Sort Like filtering #51818
Labels
>feature
:Search/Search
Search-related issues that do not fall into other categories
Team:Search
Meta label for search team
Currently we have nested sort functionality where we are able to specify filter logic, path, sortMode (min, max, sum, avg, median).
https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-sort.html#nested-sorting
It would be wonderful if there can be similar functionality for filtering where we can specify above parameters + boolean expression to evaluate whether the doc is valid.
For Example given mapping below:
and documents:
I could easily search for doc which has Sum of Toyota value greater than 100 by setting filter logic as 'term: brand= toyota', path: cars, filterMode: sum, boolean expression: totalSum > 100
Theoretically, we can achieve the same thing using script query. However, I realized that in filter context
https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-filter-context.html
_source is not available, only doc values which prohibit us from accessing nested fields.
The text was updated successfully, but these errors were encountered: