Class QuantizedByteVectorValues
java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.ByteVectorValues
org.apache.lucene.codecs.lucene104.QuantizedByteVectorValues
- All Implemented Interfaces:
HasIndexSlice
- Direct Known Subclasses:
OffHeapScalarQuantizedVectorValues
Scalar quantized byte vector values
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.KnnVectorValues
KnnVectorValues.DocIndexIterator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract QuantizedByteVectorValuescopy()Creates a new copy of thisKnnVectorValues.abstract float[]abstract floatgetCorrectiveTerms(int vectorOrd) Retrieve the corrective terms for the given vector ordinal.abstract OptimizedScalarQuantizergetSlice()Returns an IndexInput from which to read this instance's values, or null if not available.abstract VectorScorerscorer(float[] query) Return aVectorScorerfor the given query vector.Methods inherited from class org.apache.lucene.index.ByteVectorValues
checkField, fromBytes, getEncoding, rescorer, scorer, vectorValueMethods inherited from class org.apache.lucene.index.KnnVectorValues
createDenseIterator, createSparseIterator, dimension, fromDISI, getAcceptOrds, getVectorByteLength, iterator, ordToDoc, size
-
Constructor Details
-
QuantizedByteVectorValues
public QuantizedByteVectorValues()
-
-
Method Details
-
getCorrectiveTerms
public abstract OptimizedScalarQuantizer.QuantizationResult getCorrectiveTerms(int vectorOrd) throws IOException Retrieve the corrective terms for the given vector ordinal. For the dot-product family of distances, the corrective terms are, in order- the lower optimized interval
- the upper optimized interval
- the dot-product of the non-centered vector with the centroid
- the sum of quantized components
- the lower optimized interval
- the upper optimized interval
- the l2norm of the centered vector
- the sum of quantized components
- Parameters:
vectorOrd- the vector ordinal- Returns:
- the corrective terms
- Throws:
IOException- if an I/O error occurs
-
getQuantizer
- Returns:
- the quantizer used to quantize the vectors
-
getScalarEncoding
- Returns:
- the scalar encoding used to pack the stored vectors.
-
getCentroid
- Returns:
- the centroid used to center the vectors prior to quantization
- Throws:
IOException
-
getCentroidDP
- Returns:
- the dot product of the centroid.
- Throws:
IOException
-
scorer
Return aVectorScorerfor the given query vector.- Parameters:
query- the query vector- Returns:
- a
VectorScorerinstance or null - Throws:
IOException
-
copy
Description copied from class:KnnVectorValuesCreates a new copy of thisKnnVectorValues. This is helpful when you need to access different values at once, to avoid overwriting the underlying vector returned.- Specified by:
copyin classByteVectorValues- Throws:
IOException
-
getSlice
Description copied from interface:HasIndexSliceReturns an IndexInput from which to read this instance's values, or null if not available.- Specified by:
getSlicein interfaceHasIndexSlice
-