Class LuceneFloatVectorCodec
java.lang.Object
org.hibernate.search.backend.lucene.types.codec.impl.AbstractLuceneVectorFieldCodec<float[]>
org.hibernate.search.backend.lucene.types.codec.impl.LuceneFloatVectorCodec
- All Implemented Interfaces:
LuceneFieldCodec<float[],,float[]> LuceneVectorFieldCodec<float[]>
-
Field Summary
Fields inherited from class org.hibernate.search.backend.lucene.types.codec.impl.AbstractLuceneVectorFieldCodec
fieldType, log, vectorSimilarity -
Constructor Summary
ConstructorsConstructorDescriptionLuceneFloatVectorCodec(org.apache.lucene.index.VectorSimilarityFunction vectorSimilarity, int dimension, Storage storage, Indexing indexing, float[] indexNullAsValue, HibernateSearchKnnVectorsFormat knnVectorsFormat) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.index.IndexableFieldcreateIndexField(String absoluteFieldPath, float[] value) float[]decode(org.apache.lucene.index.IndexableField field) Extract the value from the given stored field.Class<float[]>float[]raw(org.apache.lucene.index.IndexableField field) floatsimilarityDistanceToScore(float distance) protected byte[]toByteArray(float[] value) Class<?>protected org.apache.lucene.index.VectorEncodingMethods inherited from class org.hibernate.search.backend.lucene.types.codec.impl.AbstractLuceneVectorFieldCodec
addToDocument, decode, encode, getConfiguredDimensions, getVectorSimilarity, isCompatibleWith, knnVectorFormat, toString
-
Constructor Details
-
LuceneFloatVectorCodec
public LuceneFloatVectorCodec(org.apache.lucene.index.VectorSimilarityFunction vectorSimilarity, int dimension, Storage storage, Indexing indexing, float[] indexNullAsValue, HibernateSearchKnnVectorsFormat knnVectorsFormat)
-
-
Method Details
-
decode
public float[] decode(org.apache.lucene.index.IndexableField field) Description copied from interface:LuceneFieldCodecExtract the value from the given stored field.Typically used in projections.
- Parameters:
field- The document field. Nevernull.- Returns:
- The decoded value.
-
raw
public float[] raw(org.apache.lucene.index.IndexableField field) -
encodedType
- Returns:
- The type of the encoded value.
-
toByteArray
protected byte[] toByteArray(float[] value) - Specified by:
toByteArrayin classAbstractLuceneVectorFieldCodec<float[]>
-
createIndexField
protected org.apache.lucene.index.IndexableField createIndexField(String absoluteFieldPath, float[] value) - Specified by:
createIndexFieldin classAbstractLuceneVectorFieldCodec<float[]>
-
vectorEncoding
protected org.apache.lucene.index.VectorEncoding vectorEncoding()- Specified by:
vectorEncodingin classAbstractLuceneVectorFieldCodec<float[]>
-
vectorElementsType
- Returns:
- The type of vector elements expected to get either
float.classorbyte.class.
-
similarityDistanceToScore
public float similarityDistanceToScore(float distance)
-