Class BasicStats
- java.lang.Object
-
- org.apache.lucene.search.similarities.Similarity.SimWeight
-
- org.apache.lucene.search.similarities.BasicStats
-
- Direct Known Subclasses:
LMSimilarity.LMStats
public class BasicStats extends Similarity.SimWeight
Stores all statistics commonly used ranking methods.
-
-
Constructor Summary
Constructors Constructor Description BasicStats(java.lang.String field, float queryBoost)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getAvgFieldLength()
Returns the average field length.long
getDocFreq()
Returns the document frequency.long
getNumberOfDocuments()
Returns the number of documents.long
getNumberOfFieldTokens()
Returns the total number of tokens in the field.float
getTotalBoost()
Returns the total boost.long
getTotalTermFreq()
Returns the total number of occurrences of this term across all documents.float
getValueForNormalization()
The square of the raw normalization value.void
normalize(float queryNorm, float topLevelBoost)
No normalization is done.void
setAvgFieldLength(float avgFieldLength)
Sets the average field length.void
setDocFreq(long docFreq)
Sets the document frequency.void
setNumberOfDocuments(long numberOfDocuments)
Sets the number of documents.void
setNumberOfFieldTokens(long numberOfFieldTokens)
Sets the total number of tokens in the field.void
setTotalTermFreq(long totalTermFreq)
Sets the total number of occurrences of this term across all documents.
-
-
-
Method Detail
-
getNumberOfDocuments
public long getNumberOfDocuments()
Returns the number of documents.
-
setNumberOfDocuments
public void setNumberOfDocuments(long numberOfDocuments)
Sets the number of documents.
-
getNumberOfFieldTokens
public long getNumberOfFieldTokens()
Returns the total number of tokens in the field.- See Also:
Terms.getSumTotalTermFreq()
-
setNumberOfFieldTokens
public void setNumberOfFieldTokens(long numberOfFieldTokens)
Sets the total number of tokens in the field.- See Also:
Terms.getSumTotalTermFreq()
-
getAvgFieldLength
public float getAvgFieldLength()
Returns the average field length.
-
setAvgFieldLength
public void setAvgFieldLength(float avgFieldLength)
Sets the average field length.
-
getDocFreq
public long getDocFreq()
Returns the document frequency.
-
setDocFreq
public void setDocFreq(long docFreq)
Sets the document frequency.
-
getTotalTermFreq
public long getTotalTermFreq()
Returns the total number of occurrences of this term across all documents.
-
setTotalTermFreq
public void setTotalTermFreq(long totalTermFreq)
Sets the total number of occurrences of this term across all documents.
-
getValueForNormalization
public float getValueForNormalization()
The square of the raw normalization value.- Specified by:
getValueForNormalization
in classSimilarity.SimWeight
- See Also:
rawNormalizationValue()
-
normalize
public void normalize(float queryNorm, float topLevelBoost)
No normalization is done.topLevelBoost
is saved in the object, however.- Specified by:
normalize
in classSimilarity.SimWeight
-
getTotalBoost
public float getTotalBoost()
Returns the total boost.
-
-