Pipeline aggregations: Sorting/Filtering after bucket_script execution

Hey,

quick update, I managed to solve this with ESQL, even though I now have to run a second query before due to not being able to run full text search within ESQL, but keyword only.

It's roughly like this, using the SUM grouped by a field and dividing it.

FROM idx |
WHERE (term LIKE "a" OR term LIKE "b") |
STATS final_score=SUM(score)/COUNT(field) BY field |
SORT final_score DESC

--Alex

P.S. Full text search matching in ESQL wanted :slight_smile:

1 Like