Interface LuceneVectorFieldCodec<F>
- Type Parameters:
F- The field type exposed to the mapper.
- All Superinterfaces:
LuceneFieldCodec<F,F>
- All Known Implementing Classes:
AbstractLuceneVectorFieldCodec,LuceneByteVectorCodec,LuceneFloatVectorCodec
Vector field specific codec that allows redefining
KnnVectorsFormat.-
Method Summary
Modifier and TypeMethodDescriptionintorg.apache.lucene.index.VectorSimilarityFunctionorg.apache.lucene.codecs.KnnVectorsFormatCustomknn vector formatthat will be used inPerFieldKnnVectorsFormatand can for example define customefConstructionormor even provide a completely custom implementation (needs to be registered via ServiceLoader mechanism).floatsimilarityDistanceToScore(float similarity) Class<?>Methods inherited from interface org.hibernate.search.backend.lucene.types.codec.impl.LuceneFieldCodec
addToDocument, decode, decode, encode, encodedType, isCompatibleWith, raw
-
Method Details
-
knnVectorFormat
org.apache.lucene.codecs.KnnVectorsFormat knnVectorFormat()Customknn vector formatthat will be used inPerFieldKnnVectorsFormatand can for example define customefConstructionormor even provide a completely custom implementation (needs to be registered via ServiceLoader mechanism). -
vectorElementsType
Class<?> vectorElementsType()- Returns:
- The type of vector elements expected to get either
float.classorbyte.class.
-
getConfiguredDimensions
int getConfiguredDimensions()- Returns:
- The number of dimensions (array length) of vectors to be indexed that this codec can process.
-
getVectorSimilarity
org.apache.lucene.index.VectorSimilarityFunction getVectorSimilarity()- Returns:
- The vector similarity function used by this codec.
-
similarityDistanceToScore
float similarityDistanceToScore(float similarity)
-