Module org.elasticsearch.server
Class IVFVectorsReader
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final recordprotected static classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.lucene.internal.hppc.IntObjectHashMap<IVFVectorsReader.FieldEntry> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedIVFVectorsReader(org.apache.lucene.index.SegmentReadState state, GenericFlatVectorReaders.LoadFlatVectorsReader loadReader) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidvoidclose()protected abstract IVFVectorsReader.FieldEntrydoReadField(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) final org.apache.lucene.index.ByteVectorValuesgetByteVectorValues(String field) abstract IVFVectorsReader.CentroidIteratorgetCentroidIterator(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) final org.apache.lucene.index.FloatVectorValuesgetFloatVectorValues(String field) getOffHeapByteSize(org.apache.lucene.index.FieldInfo fieldInfo) abstract IVFVectorsReader.PostingVisitorgetPostingVisitor(org.apache.lucene.index.FieldInfo fieldInfo, org.apache.lucene.store.IndexInput postingsLists, float[] target, org.apache.lucene.util.Bits needsScoring) final voidsearch(String field, byte[] target, org.apache.lucene.search.KnnCollector knnCollector, org.apache.lucene.search.AcceptDocs acceptDocs) final voidsearch(String field, float[] target, org.apache.lucene.search.KnnCollector knnCollector, org.apache.lucene.search.AcceptDocs acceptDocs) Methods inherited from class org.apache.lucene.codecs.KnnVectorsReader
finishMerge, getMergeInstance, mergeOffHeapByteSizeMaps
-
Field Details
-
fields
protected final org.apache.lucene.internal.hppc.IntObjectHashMap<IVFVectorsReader.FieldEntry> fields
-
-
Constructor Details
-
IVFVectorsReader
protected IVFVectorsReader(org.apache.lucene.index.SegmentReadState state, GenericFlatVectorReaders.LoadFlatVectorsReader loadReader) throws IOException - Throws:
IOException
-
-
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
- Specified by:
checkIntegrityin classorg.apache.lucene.codecs.KnnVectorsReader- Throws:
IOException
-
getFloatVectorValues
public final org.apache.lucene.index.FloatVectorValues getFloatVectorValues(String field) throws IOException - Specified by:
getFloatVectorValuesin classorg.apache.lucene.codecs.KnnVectorsReader- Throws:
IOException
-
getByteVectorValues
public final org.apache.lucene.index.ByteVectorValues getByteVectorValues(String field) throws IOException - Specified by:
getByteVectorValuesin classorg.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:
searchin classorg.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:
searchin classorg.apache.lucene.codecs.KnnVectorsReader- Throws:
IOException
-
getOffHeapByteSize
- Overrides:
getOffHeapByteSizein classorg.apache.lucene.codecs.KnnVectorsReader
-
close
- 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
-