This feature is available in versions
0.26.0 and above.pnorms=true
when creating your index, at the cost of a larger index and longer builds.
Enable the Optimization
Setpnorms=true on the tokenizer cast for each
text field used in BM25 scoring. The option defaults to false. This example
enables it for description:
pnorms=true to enable it.
Performance Tradeoff
BM25 scoring uses the length of each text field to help determine relevance. Settingpnorms=true stores an extra, denser copy of this information where the scoring
process can read it more efficiently. Depending on the data and query, this can
make queries several times faster without changing scores or relevance ranking.
For each field with pnorms enabled, the extra storage is roughly one byte per
distinct term in each document, plus metadata. The extra data also increases
the work required to build and merge index segments. Enable pnorms on fields
where faster BM25 top K queries justify those costs.