Elasticsearch: Modifying Field Normalization at Query Time (omit_norms in queries)
Asked Answered
M

0

6

Elasticsearch takes the length of a document into account when ranking (they call this field normalization). The default behavior is to rank shorter matching documents higher than longer matching documents.

Is there anyway to turn off or modify field normalization at query time? I am aware of the index time omit_norms option, but I would prefer to not reindex everything to try this out.

Also, instead of simply turning off field normalization, I wanted to try out a few things. I would like to take field length into account, but not as heavily as elasticsearch currently does. With the default behavior, a document will rank 2 times higher than a document which is two times longer. I wanted to try a non-linear relationship between ranking and length.

Mchail answered 19/2, 2015 at 6:38 Comment(2)
Which version of ElasticSearch are you using??? You’re TF/IDF tag suggests < 5.X. BM25 is used from > 5.0. Field length works a bit different therePhytogeography
When I first wrote the question, I was on 2.x, but since moved to 5.x.Mchail

© 2022 - 2024 — McMap. All rights reserved.