elastic/elasticsearch
View on GitHubAdd support for collapse sort to specify how to sort groups relative to each other
Open
#45,646 opened on Aug 16, 2019
:Search Relevance/Ranking>enhancementTeam:Search Relevancehelp wantedhigh hanging fruit
Description
This is a feature request.
At the moment, field collapsing will use the same scoring as the main query to choose the document that will appear in the main search results hits.
it would be good to have a score for the main query but another score to choose which one is going to be chosen within the field-collapsed set.
We can use inner_hit to sort the inner hits but this does not change the top document that has been chosen in the main hits. We can then manually choose the inner_hit..hits.hits[0] instead of the top hits.
I think the collapse feature would benefit from having a collapse_sort that will define the hit that will be chosen at the top level.
Thanks