ReciprocalDoubleValuesSource (Lucene 10.5.0 spatial-extras API)
Description: declaration: package: org.apache.lucene.spatial.util, class: ReciprocalDoubleValuesSource

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

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `Explanation`
  `explain(LeafReaderContext ctx, int docId, Explanation scoreExplanation)`
  `DoubleValues`
  `getValues(LeafReaderContext ctx, DoubleValues scores)`
  `int`
  `hashCode()`
  `boolean`
  `isCacheable(LeafReaderContext ctx)`
  `boolean`
  `needsScores()`
  `DoubleValuesSource`
  `rewrite(IndexSearcher searcher)`
  `String`
  `toString()`

  ### Methods inherited from class org.apache.lucene.search.DoubleValuesSource

  `constant, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, getSortField, similarityToQueryVector, similarityToQueryVector, toLongValuesSource, toSortableLongDoubleValuesSource`

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

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

- ## Constructor Details

  - ### 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 Details

  - ### getValues

    public DoubleValues getValues(LeafReaderContext ctx, DoubleValues scores) throws IOException
    Specified by:
      `getValues` in class `DoubleValuesSource`
    Throws:
      `IOException`

  - ### needsScores

    public boolean needsScores()
    Specified by:
      `needsScores` in class `DoubleValuesSource`

  - ### isCacheable

    public boolean isCacheable(LeafReaderContext ctx)

  - ### explain

    public Explanation explain(LeafReaderContext ctx, int docId, Explanation scoreExplanation) throws IOException
    Overrides:
      `explain` in class `DoubleValuesSource`
    Throws:
      `IOException`

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

  - ### toString

    public String toString()
    Specified by:
      `toString` in class `DoubleValuesSource`