java.lang.Object
org.apache.lucene.codecs.KnnVectorsReader
org.elasticsearch.index.codec.vectors.diskbbq.IVFVectorsReader
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
ES920DiskBBQVectorsReader, ESNextDiskBBQVectorsReader

public abstract class IVFVectorsReader extends org.apache.lucene.codecs.KnnVectorsReader
Reader for IVF vectors. This reader is used to read the IVF vectors from the index.
  • Field Details

  • Constructor Details

  • Method Details

    • getCentroidIterator

      public abstract IVFVectorsReader.CentroidIterator getCentroidIterator(org.apache.lucene.index.FieldInfo fieldInfo, int numCentroids, org.apache.lucene.store.IndexInput centroids, float[] target, org.apache.lucene.store.IndexInput postingListSlice, org.apache.lucene.search.AcceptDocs acceptDocs, float approximateCost, org.apache.lucene.index.FloatVectorValues values, float visitRatio) throws IOException
      Throws:
      IOException
    • doReadField

      protected abstract IVFVectorsReader.FieldEntry doReadField(org.apache.lucene.store.IndexInput input, String rawVectorFormat, boolean useDirectIOReads, org.apache.lucene.index.VectorSimilarityFunction similarityFunction, org.apache.lucene.index.VectorEncoding vectorEncoding, int numCentroids, long centroidOffset, long centroidLength, long postingListOffset, long postingListLength, float[] globalCentroid, float globalCentroidDp) throws IOException
      Throws:
      IOException
    • checkIntegrity

      public final void checkIntegrity() throws IOException
      Specified by:
      checkIntegrity in class org.apache.lucene.codecs.KnnVectorsReader
      Throws:
      IOException
    • getFloatVectorValues

      public final org.apache.lucene.index.FloatVectorValues getFloatVectorValues(String field) throws IOException
      Specified by:
      getFloatVectorValues in class org.apache.lucene.codecs.KnnVectorsReader
      Throws:
      IOException
    • getByteVectorValues

      public final org.apache.lucene.index.ByteVectorValues getByteVectorValues(String field) throws IOException
      Specified by:
      getByteVectorValues in class org.apache.lucene.codecs.KnnVectorsReader
      Throws:
      IOException
    • search

      public final void search(String field, float[] target, org.apache.lucene.search.KnnCollector knnCollector, org.apache.lucene.search.AcceptDocs acceptDocs) throws IOException
      Specified by:
      search in class org.apache.lucene.codecs.KnnVectorsReader
      Throws:
      IOException
    • search

      public final void search(String field, byte[] target, org.apache.lucene.search.KnnCollector knnCollector, org.apache.lucene.search.AcceptDocs acceptDocs) throws IOException
      Specified by:
      search in class org.apache.lucene.codecs.KnnVectorsReader
      Throws:
      IOException
    • getOffHeapByteSize

      public Map<String,Long> getOffHeapByteSize(org.apache.lucene.index.FieldInfo fieldInfo)
      Overrides:
      getOffHeapByteSize in class org.apache.lucene.codecs.KnnVectorsReader
    • close

      public void close() throws IOException
      Throws:
      IOException
    • getPostingVisitor

      public abstract IVFVectorsReader.PostingVisitor getPostingVisitor(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.store.IndexInput postingsLists, float[] target, org.apache.lucene.util.Bits needsScoring) throws IOException
      Throws:
      IOException