Module org.elasticsearch.server
Class VectorSimilarityFloatValueSource
java.lang.Object
org.apache.lucene.search.DoubleValuesSource
org.elasticsearch.index.mapper.vectors.VectorSimilarityFloatValueSource
- All Implemented Interfaces:
org.apache.lucene.search.SegmentCacheable
public class VectorSimilarityFloatValueSource
extends org.apache.lucene.search.DoubleValuesSource
DoubleValuesSource that is used to calculate scores according to a similarity function for a KnnFloatVectorField, using the
original vector values stored in the index
-
Field Summary
Fields inherited from class org.apache.lucene.search.DoubleValuesSource
SCORES -
Constructor Summary
ConstructorsConstructorDescriptionVectorSimilarityFloatValueSource(String field, float[] target, org.apache.lucene.index.VectorSimilarityFunction vectorSimilarityFunction) -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.apache.lucene.search.DoubleValuesgetValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) inthashCode()booleanisCacheable(org.apache.lucene.index.LeafReaderContext ctx) booleanorg.apache.lucene.search.DoubleValuesSourcerewrite(org.apache.lucene.search.IndexSearcher reader) toString()Methods inherited from class org.apache.lucene.search.DoubleValuesSource
constant, explain, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, similarityToQueryVector, similarityToQueryVector, toLongValuesSource, toSortableLongDoubleValuesSource
-
Constructor Details
-
VectorSimilarityFloatValueSource
public VectorSimilarityFloatValueSource(String field, float[] target, org.apache.lucene.index.VectorSimilarityFunction vectorSimilarityFunction)
-
-
Method Details
-
getValues
public org.apache.lucene.search.DoubleValues getValues(org.apache.lucene.index.LeafReaderContext ctx, org.apache.lucene.search.DoubleValues scores) throws IOException - Specified by:
getValuesin classorg.apache.lucene.search.DoubleValuesSource- Throws:
IOException
-
needsScores
public boolean needsScores()- Specified by:
needsScoresin classorg.apache.lucene.search.DoubleValuesSource
-
rewrite
public org.apache.lucene.search.DoubleValuesSource rewrite(org.apache.lucene.search.IndexSearcher reader) throws IOException - Specified by:
rewritein classorg.apache.lucene.search.DoubleValuesSource- Throws:
IOException
-
hashCode
public int hashCode()- Specified by:
hashCodein classorg.apache.lucene.search.DoubleValuesSource
-
equals
- Specified by:
equalsin classorg.apache.lucene.search.DoubleValuesSource
-
toString
- Specified by:
toStringin classorg.apache.lucene.search.DoubleValuesSource
-
isCacheable
public boolean isCacheable(org.apache.lucene.index.LeafReaderContext ctx)
-