Package org.apache.lucene.spatial.util
Class ReciprocalDoubleValuesSource
- java.lang.Object
-
- org.apache.lucene.search.DoubleValuesSource
-
- org.apache.lucene.spatial.util.ReciprocalDoubleValuesSource
-
- All Implemented Interfaces:
SegmentCacheable
public class ReciprocalDoubleValuesSource extends DoubleValuesSource
Transforms a DoubleValuesSource using the formula v = k / (v + k)
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.search.DoubleValuesSource
SCORES
-
-
Constructor Summary
Constructors Constructor Description ReciprocalDoubleValuesSource(double distToEdge, DoubleValuesSource input)Creates a ReciprocalDoubleValuesSource
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Explanationexplain(LeafReaderContext ctx, int docId, Explanation scoreExplanation)DoubleValuesgetValues(LeafReaderContext ctx, DoubleValues scores)inthashCode()booleanisCacheable(LeafReaderContext ctx)booleanneedsScores()DoubleValuesSourcerewrite(IndexSearcher searcher)StringtoString()-
Methods inherited from class org.apache.lucene.search.DoubleValuesSource
constant, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, similarityToQueryVector, similarityToQueryVector, toLongValuesSource, toSortableLongDoubleValuesSource
-
-
-
-
Constructor Detail
-
ReciprocalDoubleValuesSource
public ReciprocalDoubleValuesSource(double distToEdge, DoubleValuesSource input)Creates a ReciprocalDoubleValuesSource- Parameters:
distToEdge- the value k in v = k / (v + k)input- the input DoubleValuesSource to transform
-
-
Method Detail
-
getValues
public DoubleValues getValues(LeafReaderContext ctx, DoubleValues scores) throws IOException
- Specified by:
getValuesin classDoubleValuesSource- Throws:
IOException
-
needsScores
public boolean needsScores()
- Specified by:
needsScoresin classDoubleValuesSource
-
isCacheable
public boolean isCacheable(LeafReaderContext ctx)
-
explain
public Explanation explain(LeafReaderContext ctx, int docId, Explanation scoreExplanation) throws IOException
- Overrides:
explainin classDoubleValuesSource- Throws:
IOException
-
rewrite
public DoubleValuesSource rewrite(IndexSearcher searcher) throws IOException
- Specified by:
rewritein classDoubleValuesSource- Throws:
IOException
-
equals
public boolean equals(Object o)
- Specified by:
equalsin classDoubleValuesSource
-
hashCode
public int hashCode()
- Specified by:
hashCodein classDoubleValuesSource
-
toString
public String toString()
- Specified by:
toStringin classDoubleValuesSource
-
-