Web / Apache Lucene Interview questions
Why should you use Norms and when can they be disabled?
Norms are small per-document, per-field values that factor field length and any index-time boost into scoring - they're part of why a term match in a short title typically scores higher than the same term buried in a long body field.
Storing norms costs a small amount of memory per field per document, and that cost is paid whether or not the field is ever used for relevance-sensitive queries. For fields used purely for filtering, sorting, or faceting - where scoring precision is irrelevant - disabling norms via the FieldType (setOmitNorms(true)) removes that overhead with no downside.
The trade-off only bites if you later start running relevance-scored queries against a field with norms disabled - length normalization silently stops applying to it. So the safe rule is: disable norms only on fields you're confident will never need length-aware scoring.
More Related questions...