public class BasicStats extends Similarity.SimWeight
Modifier and Type | Field and Description |
---|---|
protected float |
avgFieldLength
The average field length.
|
protected long |
docFreq
The document frequency.
|
protected long |
numberOfDocuments
The number of documents.
|
protected long |
numberOfFieldTokens
The total number of tokens in the field.
|
protected float |
queryBoost
Query's inner boost.
|
protected float |
topLevelBoost
Any outer query's boost.
|
protected float |
totalBoost
For most Similarities, the immediate and the top level query boosts are
not handled differently.
|
protected long |
totalTermFreq
The total number of occurrences of this term across all documents.
|
Constructor and Description |
---|
BasicStats(String field,
float queryBoost)
Constructor.
|
Modifier and Type | Method and 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.
|
protected float |
rawNormalizationValue()
Computes the raw normalization value.
|
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.
|
protected long numberOfDocuments
protected long numberOfFieldTokens
protected float avgFieldLength
protected long docFreq
protected long totalTermFreq
protected final float queryBoost
protected float topLevelBoost
protected float totalBoost
public BasicStats(String field, float queryBoost)
public long getNumberOfDocuments()
public void setNumberOfDocuments(long numberOfDocuments)
public long getNumberOfFieldTokens()
Terms.getSumTotalTermFreq()
public void setNumberOfFieldTokens(long numberOfFieldTokens)
Terms.getSumTotalTermFreq()
public float getAvgFieldLength()
public void setAvgFieldLength(float avgFieldLength)
public long getDocFreq()
public void setDocFreq(long docFreq)
public long getTotalTermFreq()
public void setTotalTermFreq(long totalTermFreq)
public float getValueForNormalization()
getValueForNormalization
in class Similarity.SimWeight
rawNormalizationValue()
protected float rawNormalizationValue()
normalize(float, float)
, etc.public void normalize(float queryNorm, float topLevelBoost)
topLevelBoost
is saved in the object,
however.normalize
in class Similarity.SimWeight
public float getTotalBoost()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.