Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to remove the calculation of length norms for fields in elastic search?

lengthNorm is one of the three factors going into calculating the norm for a field.

In elastic search, one can turn off field normals with "omit_norms" : true

Unfortunately, this causes no index-time boost to be applied when querying against such fields.

Is there some way to strictly turn off the calculation of lengthNorm?

I need field-level index-time boost, but I really need the length of the field not to matter.


Reference

enter image description here

like image 342
Brian Webster Avatar asked Jan 24 '13 23:01

Brian Webster


1 Answers

The lengthNorm and field level boosting, as you said, are both stored in the norm. So no, you can't have one without the other.

But you don't actually need field boosting at index time. You can apply it at search time instead, and that way you have more flexibility when you want to tweak the boost level later on.

Not only that, by setting omit_norms you reduce the amount of data you have to store at index time by quite a lot, so it is to be recommended where appropriate (such as in your case).

like image 186
DrTech Avatar answered Oct 14 '22 05:10

DrTech