java.lang.Object
org.apache.lucene.search.VectorScorer
- Direct Known Subclasses:
VectorScorer.ByteVectorScorer
,VectorScorer.FloatVectorScorer
Computes the similarity score between a given query vector and different document vectors. This
is primarily used by
KnnFloatVectorQuery
to run an exact, exhaustive search over the
vectors.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract boolean
advanceExact
(int doc) (package private) static VectorScorer.ByteVectorScorer
create
(LeafReaderContext context, FieldInfo fi, byte[] query) (package private) static VectorScorer.FloatVectorScorer
create
(LeafReaderContext context, FieldInfo fi, float[] query) Create a new vector scorer instance.(package private) abstract float
score()
Compute the similarity score for the current document.
-
Field Details
-
similarity
-
-
Constructor Details
-
VectorScorer
VectorScorer(VectorSimilarityFunction similarity)
-
-
Method Details
-
create
static VectorScorer.FloatVectorScorer create(LeafReaderContext context, FieldInfo fi, float[] query) throws IOException Create a new vector scorer instance.- Parameters:
context
- the reader contextfi
- the FieldInfo for the field containing document vectorsquery
- the query vector to compute the similarity for- Throws:
IOException
-
create
static VectorScorer.ByteVectorScorer create(LeafReaderContext context, FieldInfo fi, byte[] query) throws IOException - Throws:
IOException
-
score
Compute the similarity score for the current document.- Throws:
IOException
-
advanceExact
- Throws:
IOException
-