public class DistanceValueSource extends DoubleValuesSource
PointVectorStrategy
.SCORES
Constructor and Description |
---|
DistanceValueSource(PointVectorStrategy strategy,
org.locationtech.spatial4j.shape.Point from,
double multiplier)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
DoubleValues |
getValues(LeafReaderContext readerContext,
DoubleValues scores)
Returns the FunctionValues used by the function query.
|
int |
hashCode() |
boolean |
isCacheable(LeafReaderContext ctx) |
boolean |
needsScores()
Return true if document scores are needed to calculate values
|
DoubleValuesSource |
rewrite(IndexSearcher searcher)
Return a DoubleValuesSource specialised for the given IndexSearcher
Implementations should assume that this will only be called once.
|
java.lang.String |
toString()
Returns the ValueSource description.
|
constant, explain, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, toLongValuesSource
public DistanceValueSource(PointVectorStrategy strategy, org.locationtech.spatial4j.shape.Point from, double multiplier)
public java.lang.String toString()
toString
in class DoubleValuesSource
public DoubleValues getValues(LeafReaderContext readerContext, DoubleValues scores) throws java.io.IOException
getValues
in class DoubleValuesSource
java.io.IOException
public boolean needsScores()
DoubleValuesSource
needsScores
in class DoubleValuesSource
public boolean isCacheable(LeafReaderContext ctx)
true
if the object can be cached against a given leafpublic DoubleValuesSource rewrite(IndexSearcher searcher) throws java.io.IOException
DoubleValuesSource
this
Queries that use DoubleValuesSource objects should call rewrite() during
Query.createWeight(IndexSearcher, boolean, float)
rather than during
Query.rewrite(IndexReader)
to avoid IndexReader reference leakagerewrite
in class DoubleValuesSource
java.io.IOException
public boolean equals(java.lang.Object o)
equals
in class DoubleValuesSource
public int hashCode()
hashCode
in class DoubleValuesSource
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.