|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.search.Similarity
org.ow2.weblab.services.duplicates.CustomSimilarity
public class CustomSimilarity
Expert: Default scoring implementation.
| Field Summary | |
|---|---|
protected boolean |
discountOverlaps
|
| Fields inherited from class org.apache.lucene.search.Similarity |
|---|
NO_DOC_ID_PROVIDED |
| Constructor Summary | |
|---|---|
CustomSimilarity()
|
|
| Method Summary | |
|---|---|
float |
computeNorm(java.lang.String field,
org.apache.lucene.index.FieldInvertState state)
Implemented as state.getBoost()*lengthNorm(numTerms), where
numTerms is FieldInvertState.getLength() if setDiscountOverlaps(boolean) is false, else it's FieldInvertState.getLength() - FieldInvertState.getNumOverlap(). |
float |
coord(int overlap,
int maxOverlap)
Implemented as overlap / maxOverlap. |
boolean |
getDiscountOverlaps()
|
float |
idf(int docFreq,
int numDocs)
Implemented as log(numDocs/(docFreq+1)) + 1. |
float |
lengthNorm(java.lang.String fieldName,
int numTerms)
Implemented as 1/sqrt(numTerms). |
float |
queryNorm(float sumOfSquaredWeights)
Implemented as 1/sqrt(sumOfSquaredWeights). |
void |
setDiscountOverlaps(boolean v)
Determines whether overlap tokens (Tokens with 0 position increment) are ignored when computing norm. |
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, idfExplain, idfExplain, scorePayload, scorePayload, setDefault, tf |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean discountOverlaps
| Constructor Detail |
|---|
public CustomSimilarity()
| Method Detail |
|---|
public float computeNorm(java.lang.String field,
org.apache.lucene.index.FieldInvertState state)
state.getBoost()*lengthNorm(numTerms), where
numTerms is FieldInvertState.getLength() if setDiscountOverlaps(boolean) is false, else it's FieldInvertState.getLength() - FieldInvertState.getNumOverlap().
WARNING: This API is new and experimental, and may suddenly change.
computeNorm in class org.apache.lucene.search.Similarity
public float lengthNorm(java.lang.String fieldName,
int numTerms)
1/sqrt(numTerms).
lengthNorm in class org.apache.lucene.search.Similaritypublic float queryNorm(float sumOfSquaredWeights)
1/sqrt(sumOfSquaredWeights).
queryNorm in class org.apache.lucene.search.Similaritypublic float tf(float freq)
sqrt(freq).
tf in class org.apache.lucene.search.Similaritypublic float sloppyFreq(int distance)
1 / (distance + 1).
sloppyFreq in class org.apache.lucene.search.Similarity
public float idf(int docFreq,
int numDocs)
log(numDocs/(docFreq+1)) + 1.
idf in class org.apache.lucene.search.Similarity
public float coord(int overlap,
int maxOverlap)
overlap / maxOverlap.
coord in class org.apache.lucene.search.Similaritypublic void setDiscountOverlaps(boolean v)
WARNING: This API is new and experimental, and may suddenly change.
computeNorm(java.lang.String, org.apache.lucene.index.FieldInvertState)public boolean getDiscountOverlaps()
setDiscountOverlaps(boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||