Class VectorSimilarityFloatValueSource

java.lang.Object
org.apache.lucene.search.DoubleValuesSource
org.elasticsearch.index.mapper.vectors.VectorSimilarityFloatValueSource
All Implemented Interfaces:
org.apache.lucene.search.SegmentCacheable

public class VectorSimilarityFloatValueSource extends org.apache.lucene.search.DoubleValuesSource
DoubleValuesSource that is used to calculate scores according to a similarity function for a KnnFloatVectorField, using the original vector values stored in the index
  • Field Summary

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

    SCORES
  • Constructor Summary

    Constructors
    Constructor
    Description
    VectorSimilarityFloatValueSource(String field, float[] target, org.apache.lucene.index.VectorSimilarityFunction vectorSimilarityFunction)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    org.apache.lucene.search.DoubleValues
    getValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores)
     
    int
     
    boolean
    isCacheable(org.apache.lucene.index.LeafReaderContext ctx)
     
    boolean
     
    org.apache.lucene.search.DoubleValuesSource
    rewrite(org.apache.lucene.search.IndexSearcher reader)
     
     

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

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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • VectorSimilarityFloatValueSource

      public VectorSimilarityFloatValueSource(String field, float[] target, org.apache.lucene.index.VectorSimilarityFunction vectorSimilarityFunction)
  • Method Details

    • getValues

      public org.apache.lucene.search.DoubleValues getValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) throws IOException
      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
    • rewrite

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

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

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

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

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