Class BasicStats
java.lang.Object
org.apache.lucene.search.similarities.BasicStats
- Direct Known Subclasses:
LMSimilarity.LMStats
Stores all statistics commonly used ranking methods.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleThe average field length.protected final doubleA query boost.protected longThe document frequency.protected longThe number of documents.protected longThe total number of tokens in the field.protected longThe total number of occurrences of this term across all documents. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the average field length.doublegetBoost()Returns the total boost.longReturns the document frequency.longReturns the number of documents.longReturns the total number of tokens in the field.longReturns the total number of occurrences of this term across all documents.voidsetAvgFieldLength(double 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.
-
Field Details
-
numberOfDocuments
protected long numberOfDocumentsThe number of documents. -
numberOfFieldTokens
protected long numberOfFieldTokensThe total number of tokens in the field. -
avgFieldLength
protected double avgFieldLengthThe average field length. -
docFreq
protected long docFreqThe document frequency. -
totalTermFreq
protected long totalTermFreqThe total number of occurrences of this term across all documents. -
boost
protected final double boostA query boost. Should be applied as a multiplicative factor to the score.
-
-
Constructor Details
-
BasicStats
Constructor.
-
-
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 double getAvgFieldLength()Returns the average field length. -
setAvgFieldLength
public void setAvgFieldLength(double 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. -
getBoost
public double getBoost()Returns the total boost.
-