Class BasicStats
java.lang.Object
org.apache.lucene.search.similarities.Similarity.SimWeight
org.apache.lucene.search.similarities.BasicStats
- Direct Known Subclasses:
LMSimilarity.LMStats
Stores all statistics commonly used ranking methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the average field length.longReturns the document frequency.longReturns the number of documents.longReturns the total number of tokens in the field.floatReturns the total boost.longReturns the total number of occurrences of this term across all documents.floatThe square of the raw normalization value.voidnormalize(float queryNorm, float topLevelBoost) No normalization is done.voidsetAvgFieldLength(float avgFieldLength) Sets the average field length.voidsetDocFreq(long docFreq) Sets the document frequency.voidsetNumberOfDocuments(long numberOfDocuments) Sets the number of documents.voidsetNumberOfFieldTokens(long numberOfFieldTokens) Sets the total number of tokens in the field.voidsetTotalTermFreq(long totalTermFreq) Sets the total number of occurrences of this term across all documents.
-
Constructor Details
-
BasicStats
Constructor. Sets the query boost.
-
-
Method Details
-
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:
-
setNumberOfFieldTokens
public void setNumberOfFieldTokens(long numberOfFieldTokens) Sets the total number of tokens in the field.- See Also:
-
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:
getValueForNormalizationin classSimilarity.SimWeight- See Also:
-
normalize
public void normalize(float queryNorm, float topLevelBoost) No normalization is done.topLevelBoostis saved in the object, however.- Specified by:
normalizein classSimilarity.SimWeight
-
getTotalBoost
public float getTotalBoost()Returns the total boost.
-