java.lang.Objectorg.apache.lucene.search.Similarity
org.apache.lucene.search.DefaultSimilarity
org.apache.lucene.misc.SweetSpotSimilarity
All Implemented Interfaces:
Serializable
For lengthNorm, A global min/max can be specified to define the platuea of lengths that should all have a norm of 1.0. Below the min, and above the max the lengthNorm drops off in a sqrt function.
A per field min/max can be specified if different fields have different sweet spots.
For tf, baselineTf and hyperbolicTf functions are provided, which subclasses can choose between.
| Constructor: |
|---|
|
| Method from org.apache.lucene.misc.SweetSpotSimilarity Summary: |
|---|
| baselineTf, hyperbolicTf, lengthNorm, setBaselineTfFactors, setHyperbolicTfFactors, setLengthNormFactors, setLengthNormFactors, tf |
| Methods from org.apache.lucene.search.DefaultSimilarity: |
|---|
| coord, idf, lengthNorm, queryNorm, sloppyFreq, tf |
| Methods from org.apache.lucene.search.Similarity: |
|---|
| coord, decodeNorm, encodeNorm, getDefault, getNormDecoder, idf, idf, idf, lengthNorm, queryNorm, scorePayload, setDefault, sloppyFreq, tf, tf |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.lucene.misc.SweetSpotSimilarity Detail: |
|---|
(x <= min) ? base : sqrt(x+(base**2)-min)
...but with a special case check for 0.
This degrates to |
tf(x)=min+(max-min)/2*(((base**(x-xoffset)-base**-(x-xoffset))/(base**(x-xoffset)+base**-(x-xoffset)))+1)
This code is provided as a convincience for subclasses that want to use a hyperbolic tf function. |
1/sqrt( steepness * (abs(x-min) + abs(x-max) - (max-min)) + 1 )
.
This degrades to :TODO: potential optimiation is to just flat out return 1.0f if numTerms is between min and max. |
|
|
|
|
|