Class QuantizedByteVectorValues
java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.ByteVectorValues
org.apache.lucene.util.quantization.BaseQuantizedByteVectorValues
org.apache.lucene.util.quantization.QuantizedByteVectorValues
- All Implemented Interfaces:
HasIndexSlice
- Direct Known Subclasses:
OffHeapScalarQuantizedVectorValues
Scalar quantized byte vector values
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAllowed encodings for scalar quantization.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 OptimizedScalarQuantizerMethods inherited from class org.apache.lucene.util.quantization.BaseQuantizedByteVectorValues
getSlice, scorerMethods 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, prefetch, 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
-
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
-