Zend_Search_Lucene_Search_Similarity::lengthNorm
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 implemenations of this method usually return smaller values when 'numTokens' is large, and larger values when 'numTokens' is small. That these values are computed under IndexWriter::addDocument(Document) and stored then using encodeNorm(float). Thus they have limited precision, and documents must be re-indexed if this method is altered. fieldName - name of field numTokens - the total number of tokens contained in fields named 'fieldName' of 'doc'. Returns a normalization factor for hits on this field of this document
Signature
public function lengthNorm(string
$fieldName,
integer
$numTokens )
Parameters
$fieldName
— string$numTokens
— integer
Returns
- float