Class DistanceValueSource

  • All Implemented Interfaces:
    org.apache.lucene.search.SegmentCacheable

    public class DistanceValueSource
    extends org.apache.lucene.search.DoubleValuesSource
    An implementation of the Lucene ValueSource model that returns the distance for a PointVectorStrategy.
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
    • Field Summary

      • Fields inherited from class org.apache.lucene.search.DoubleValuesSource

        SCORES
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object o)  
      org.apache.lucene.search.DoubleValues getValues​(org.apache.lucene.index.LeafReaderContext readerContext, org.apache.lucene.search.DoubleValues scores)
      Returns the FunctionValues used by the function query.
      int hashCode()  
      boolean isCacheable​(org.apache.lucene.index.LeafReaderContext ctx)  
      boolean needsScores()  
      org.apache.lucene.search.DoubleValuesSource rewrite​(org.apache.lucene.search.IndexSearcher searcher)  
      String toString()
      Returns the ValueSource description.
      • Methods inherited from class org.apache.lucene.search.DoubleValuesSource

        constant, explain, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, toLongValuesSource
    • Constructor Detail

      • DistanceValueSource

        public DistanceValueSource​(PointVectorStrategy strategy,
                                   org.locationtech.spatial4j.shape.Point from,
                                   double multiplier)
        Constructor.
    • Method Detail

      • toString

        public String toString()
        Returns the ValueSource description.
        Specified by:
        toString in class org.apache.lucene.search.DoubleValuesSource
      • getValues

        public org.apache.lucene.search.DoubleValues getValues​(org.apache.lucene.index.LeafReaderContext readerContext,
                                                               org.apache.lucene.search.DoubleValues scores)
                                                        throws IOException
        Returns the FunctionValues used by the function query.
        Specified by:
        getValues in class org.apache.lucene.search.DoubleValuesSource
        Throws:
        IOException
      • needsScores

        public boolean needsScores()
        Specified by:
        needsScores in class org.apache.lucene.search.DoubleValuesSource
      • isCacheable

        public boolean isCacheable​(org.apache.lucene.index.LeafReaderContext ctx)
      • rewrite

        public org.apache.lucene.search.DoubleValuesSource rewrite​(org.apache.lucene.search.IndexSearcher searcher)
                                                            throws IOException
        Specified by:
        rewrite in class org.apache.lucene.search.DoubleValuesSource
        Throws:
        IOException
      • equals

        public boolean equals​(Object o)
        Specified by:
        equals in class org.apache.lucene.search.DoubleValuesSource
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class org.apache.lucene.search.DoubleValuesSource