Normalize Elasticsearch score with subfield length

I have some documents in ElasticSearch, and each document has one or many appendices. When I do a search on the text of the appendices, I often got scores greater than 1. When I do searches with really common patterns, I realize that more the document has appendices, greater its score is. So, I aim to 'normalize' the scores, by dividing each document score by the number of appendices it has.

For example, for this query:

"query": {
  "match": {
    "document.appendices.text" = "What is love?"
  }
}

I wish to do score = score / length(document.appendices) but I don't know how to express it.

It that possible, or all the appendices has to be indexed as document to achieve this?

Many thanks community!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.