Class Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues
java.lang.Object
org.apache.lucene.index.KnnVectorValues
org.apache.lucene.index.FloatVectorValues
org.apache.lucene.codecs.lucene104.Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues
- Enclosing class:
Lucene104ScalarQuantizedVectorsReader
protected static final class Lucene104ScalarQuantizedVectorsReader.ScalarQuantizedVectorValues
extends FloatVectorValues
Vector values holding row and quantized vector values
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.KnnVectorValues
KnnVectorValues.DocIndexIterator -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a new copy of thisKnnVectorValues.intReturn the dimension of the vectorsgetAcceptOrds(Bits acceptDocs) Returns a Bits accepting docs accepted by the argument and having a vector valueiterator()Create an iterator for this instance.intordToDoc(int ord) Return the docid of the document indexed with the given vector ordinal.rescorer(float[] target) Rescore using the given query vector and the currentFloatVectorValues.scorer(float[] query) Return aVectorScorerfor the given query vector and the currentFloatVectorValues.intsize()Return the number of vectors for this field.float[]vectorValue(int ord) Return the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown.Methods inherited from class org.apache.lucene.index.FloatVectorValues
checkField, fromFloats, getEncodingMethods inherited from class org.apache.lucene.index.KnnVectorValues
createDenseIterator, createSparseIterator, fromDISI, getVectorByteLength
-
Method Details
-
dimension
public int dimension()Description copied from class:KnnVectorValuesReturn the dimension of the vectors- Specified by:
dimensionin classKnnVectorValues
-
size
public int size()Description copied from class:KnnVectorValuesReturn the number of vectors for this field.- Specified by:
sizein classKnnVectorValues- Returns:
- the number of vectors returned by this iterator
-
vectorValue
Description copied from class:FloatVectorValuesReturn the vector value for the given vector ordinal which must be in [0, size() - 1], otherwise IndexOutOfBoundsException is thrown. The returned array may be shared across calls.- Specified by:
vectorValuein classFloatVectorValues- Returns:
- the vector value
- 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 classFloatVectorValues- Throws:
IOException
-
getAcceptOrds
Description copied from class:KnnVectorValuesReturns a Bits accepting docs accepted by the argument and having a vector value- Overrides:
getAcceptOrdsin classKnnVectorValues
-
ordToDoc
public int ordToDoc(int ord) Description copied from class:KnnVectorValuesReturn the docid of the document indexed with the given vector ordinal. This default implementation returns the argument and is appropriate for dense values implementations where every doc has a single value.- Overrides:
ordToDocin classKnnVectorValues
-
iterator
Description copied from class:KnnVectorValuesCreate an iterator for this instance.- Overrides:
iteratorin classKnnVectorValues
-
scorer
Description copied from class:FloatVectorValuesReturn aVectorScorerfor the given query vector and the currentFloatVectorValues. When the underlying format quantizes the vectors, this will return aVectorScorerthat scores against the quantized vectors.- Overrides:
scorerin classFloatVectorValues- Parameters:
query- the query vector- Returns:
- a
VectorScorerinstance or null - Throws:
IOException
-
rescorer
Description copied from class:FloatVectorValuesRescore using the given query vector and the currentFloatVectorValues. This is unique from scorer() in that it is explicitly for rescoring an existing set of hits and thus will often utilize the highest fidelity scoring algorithm available. This is useful when the initial search used a quantized index or an approximate search algorithm, and now we want to rescore the hits using the full fidelity vectors. The default implementation is to callFloatVectorValues.scorer(float[])assuming that the scorer is already the highest fidelity implementation available.- Overrides:
rescorerin classFloatVectorValues- Parameters:
target- the query vector- Returns:
- a
VectorScorerinstance or null - Throws:
IOException- if an I/O error occurs
-