|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.Similarity
org.apache.lucene.search.DefaultSimilarity
public class DefaultSimilarity
Expert: Default scoring implementation.
Constructor Summary | |
---|---|
DefaultSimilarity()
|
Method Summary | |
---|---|
float |
coord(int overlap,
int maxOverlap)
Implemented as overlap / maxOverlap . |
float |
idf(int docFreq,
int numDocs)
Implemented as log(numDocs/(docFreq+1)) + 1 . |
float |
lengthNorm(String fieldName,
int numTerms)
Implemented as 1/sqrt(numTerms) . |
float |
queryNorm(float sumOfSquaredWeights)
Implemented as 1/sqrt(sumOfSquaredWeights) . |
float |
sloppyFreq(int distance)
Implemented as 1 / (distance + 1) . |
float |
tf(float freq)
Implemented as sqrt(freq) . |
Methods inherited from class org.apache.lucene.search.Similarity |
---|
decodeNorm, encodeNorm, getDefault, getNormDecoder, idf, idf, scorePayload, setDefault, tf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultSimilarity()
Method Detail |
---|
public float lengthNorm(String fieldName, int numTerms)
1/sqrt(numTerms)
.
lengthNorm
in class Similarity
fieldName
- the name of the fieldnumTerms
- the total number of tokens contained in fields named
fieldName of doc.
AbstractField.setBoost(float)
public float queryNorm(float sumOfSquaredWeights)
1/sqrt(sumOfSquaredWeights)
.
queryNorm
in class Similarity
sumOfSquaredWeights
- the sum of the squares of query term weights
public float tf(float freq)
sqrt(freq)
.
tf
in class Similarity
freq
- the frequency of a term within a document
public float sloppyFreq(int distance)
1 / (distance + 1)
.
sloppyFreq
in class Similarity
distance
- the edit distance of this sloppy phrase match
PhraseQuery.setSlop(int)
public float idf(int docFreq, int numDocs)
log(numDocs/(docFreq+1)) + 1
.
idf
in class Similarity
docFreq
- the number of documents which contain the termnumDocs
- the total number of documents in the collection
public float coord(int overlap, int maxOverlap)
overlap / maxOverlap
.
coord
in class Similarity
overlap
- the number of query terms matched in the documentmaxOverlap
- the total number of terms in the query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |