Method LengthNorm
LengthNorm(String, Int32)
Computes the normalization value for a field given the total number of terms contained in a field. These values, together with field boosts, are stored in an index and multipled into scores for hits on each field by the search code.
Matches in longer fields are less precise, so implementations of this
method usually return smaller values when numTokens
is large,
and larger values when numTokens
is small.
Note that the return values are computed under
AddDocument(Document)
and then stored using
EncodeNorm(Single).
Thus they have limited precision, and documents
must be re-indexed if this method is altered.
Declaration
public abstract float LengthNorm(String fieldName, int numTokens)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | the name of the field |
System.Int32 | numTokens | the total number of tokens contained in fields named fieldName of doc. |
Returns
Type | Description |
---|---|
System.Single | a normalization factor for hits on this field of this document |