Module org.apache.lucene.core
Package org.apache.lucene.search
Class FloatVectorSimilarityValuesSource
java.lang.Object
org.apache.lucene.search.DoubleValuesSource
org.apache.lucene.search.VectorSimilarityValuesSource
org.apache.lucene.search.FloatVectorSimilarityValuesSource
- All Implemented Interfaces:
SegmentCacheable
A
DoubleValuesSource
which computes the vector similarity scores between the query vector
and the KnnFloatVectorField
for documents.-
Field Summary
FieldsFields inherited from class org.apache.lucene.search.VectorSimilarityValuesSource
fieldName
Fields inherited from class org.apache.lucene.search.DoubleValuesSource
SCORES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getValues
(LeafReaderContext ctx, DoubleValues scores) Returns aDoubleValues
instance for the passed-in LeafReaderContext and scoresint
hashCode()
toString()
Methods inherited from class org.apache.lucene.search.VectorSimilarityValuesSource
isCacheable, needsScores, rewrite
Methods inherited from class org.apache.lucene.search.DoubleValuesSource
constant, explain, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, similarityToQueryVector, similarityToQueryVector, toLongValuesSource
-
Field Details
-
queryVector
private final float[] queryVector
-
-
Constructor Details
-
FloatVectorSimilarityValuesSource
-
-
Method Details
-
getValues
Description copied from class:DoubleValuesSource
Returns aDoubleValues
instance for the passed-in LeafReaderContext and scoresIf scores are not needed to calculate the values (ie
returns false
, callers may safely passnull
for thescores
parameter.- Specified by:
getValues
in classVectorSimilarityValuesSource
- Throws:
IOException
-
hashCode
public int hashCode()- Specified by:
hashCode
in classDoubleValuesSource
-
equals
- Specified by:
equals
in classDoubleValuesSource
-
toString
- Specified by:
toString
in classDoubleValuesSource
-