Class DenormalizedCosineFloatVectorValues

java.lang.Object
org.apache.lucene.search.DocIdSetIterator
org.apache.lucene.index.FloatVectorValues
org.elasticsearch.index.mapper.vectors.DenormalizedCosineFloatVectorValues

public class DenormalizedCosineFloatVectorValues extends org.apache.lucene.index.FloatVectorValues
Provides the denormalized vectors. Float vectors stored with cosine similarity are normalized by default. So when reading the value for scripts, we to denormalize them.
  • Field Summary

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

    NO_MORE_DOCS
  • Constructor Summary

    Constructors
    Constructor
    Description
    DenormalizedCosineFloatVectorValues(org.apache.lucene.index.FloatVectorValues in, org.apache.lucene.index.NumericDocValues magnitudeIn)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    advance(int target)
     
    int
     
    int
     
    float
     
    int
     
    int
     
    float[]
     

    Methods inherited from class org.apache.lucene.index.FloatVectorValues

    cost

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

    all, empty, range, slowAdvance

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DenormalizedCosineFloatVectorValues

      public DenormalizedCosineFloatVectorValues(org.apache.lucene.index.FloatVectorValues in, org.apache.lucene.index.NumericDocValues magnitudeIn)
  • Method Details

    • dimension

      public int dimension()
      Specified by:
      dimension in class org.apache.lucene.index.FloatVectorValues
    • size

      public int size()
      Specified by:
      size in class org.apache.lucene.index.FloatVectorValues
    • vectorValue

      public float[] vectorValue() throws IOException
      Specified by:
      vectorValue in class org.apache.lucene.index.FloatVectorValues
      Throws:
      IOException
    • docID

      public int docID()
      Specified by:
      docID in class org.apache.lucene.search.DocIdSetIterator
    • nextDoc

      public int nextDoc() throws IOException
      Specified by:
      nextDoc in class org.apache.lucene.search.DocIdSetIterator
      Throws:
      IOException
    • advance

      public int advance(int target) throws IOException
      Specified by:
      advance in class org.apache.lucene.search.DocIdSetIterator
      Throws:
      IOException
    • magnitude

      public float magnitude()