Package org.apache.lucene.spatial.vector

## Class DistanceValueSource

- java.lang.Object
- - org.apache.lucene.search.DoubleValuesSource
  - - org.apache.lucene.spatial.vector.DistanceValueSource

- All Implemented Interfaces:
    `SegmentCacheable`

      public class DistanceValueSource
      extends DoubleValuesSource

  A DoubleValuesSource 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`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DistanceValueSource​(PointVectorStrategy strategy, org.locationtech.spatial4j.shape.Point from, double multiplier)` | Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(Object o)` |
    `DoubleValues` | `getValues​(LeafReaderContext readerContext, DoubleValues scores)` | Returns the FunctionValues used by the function query.
    `int` | `hashCode()` |
    `boolean` | `isCacheable​(LeafReaderContext ctx)` |
    `boolean` | `needsScores()` |
    `DoubleValuesSource` | `rewrite​(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, similarityToQueryVector, similarityToQueryVector, toLongValuesSource`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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 `DoubleValuesSource`

    - #### getValues

          public DoubleValues getValues​(LeafReaderContext readerContext,
                                        DoubleValues scores)
                                 throws IOException

      Returns the FunctionValues used by the function query.
      Specified by:
        `getValues` in class `DoubleValuesSource`
      Throws:
        `IOException`

    - #### needsScores

          public boolean needsScores()

      Specified by:
        `needsScores` in class `DoubleValuesSource`

    - #### isCacheable

          public boolean isCacheable​(LeafReaderContext ctx)

    - #### rewrite

          public DoubleValuesSource rewrite​(IndexSearcher searcher)
                                     throws IOException

      Specified by:
        `rewrite` in class `DoubleValuesSource`
      Throws:
        `IOException`

    - #### equals

          public boolean equals​(Object o)

      Specified by:
        `equals` in class `DoubleValuesSource`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `DoubleValuesSource`