Allow rescorer with field collapsing
This change adds the support for rescoring collapsed documents. The rescoring is applied on the top document per group on each shard.
Closes #27243
Pinging @elastic/es-search (Team:Search)
Do we think we could also add rescore support for inner hits in the future
That's a good question. Adding the rescoring for inner_hits should be trivial since we can copy the rescorer into the expand query. I wanted to add that initially but then realise that users may want to apply a different window_size when rescoring inside each group. The original window_size might be too big to apply on every group since that would be applied on each top docs request per group. I left it for a follow up and added a warning in the doc for now.