java.lang.Object
org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer
org.elasticsearch.simdvec.internal.Int4VectorScorer
- All Implemented Interfaces:
org.apache.lucene.util.hnsw.HasKnnVectorValues,org.apache.lucene.util.hnsw.RandomVectorScorer
public final class Int4VectorScorer
extends org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer
Int4 packed-nibble query-time scorer. The float query is quantized externally
and passed in as unpacked bytes (one byte per dimension, 0-15 range) along
with corrective terms. Each stored vector is
dims/2 packed bytes
followed by corrective terms (3 floats + 1 int).-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomVectorScorer
org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer -
Method Summary
Modifier and TypeMethodDescriptionfloatbulkScore(int[] ordinals, float[] scores, int numNodes) static Optional<org.apache.lucene.util.hnsw.RandomVectorScorer> create(org.apache.lucene.index.VectorSimilarityFunction sim, org.apache.lucene.codecs.lucene104.QuantizedByteVectorValues values, byte[] unpackedQuery, float lowerInterval, float upperInterval, float additionalCorrection, int quantizedComponentSum) Creates an int4 query-time scorer if the input supports efficient access.floatscore(int node) Methods inherited from class org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer
getAcceptOrds, maxOrd, ordToDoc, values
-
Method Details
-
create
public static Optional<org.apache.lucene.util.hnsw.RandomVectorScorer> create(org.apache.lucene.index.VectorSimilarityFunction sim, org.apache.lucene.codecs.lucene104.QuantizedByteVectorValues values, byte[] unpackedQuery, float lowerInterval, float upperInterval, float additionalCorrection, int quantizedComponentSum) Creates an int4 query-time scorer if the input supports efficient access.- Parameters:
sim- the similarity functionvalues- the quantized vector valuesunpackedQuery- the quantized query (dims bytes, one per dimension, 0-15)lowerInterval- query corrective termupperInterval- query corrective termadditionalCorrection- query corrective termquantizedComponentSum- query corrective term- Returns:
- an optional scorer or empty if the input doesn't support native access
-
score
- Throws:
IOException
-
bulkScore
- Throws:
IOException
-