Array scoring: max instead of sum

(afmercure) #1


My documents have an "aliases" field which is an array of string.
When I query that field, ES scores each matching alias and uses the sum of
these scores to calculate the document's score. However, I would like to
use the max of these scores.
I don't care if a document has many aliases matching my query. I want to
know what document has the one alias that best matches my query.

Is there any easy way to accomplish this? Do I need to use a function
score query (if so, please gibe me some implementation hints).

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit

(system) #2