Class LuceneByteVectorCodec
java.lang.Object
org.hibernate.search.backend.lucene.types.codec.impl.AbstractLuceneVectorFieldCodec<byte[]>
org.hibernate.search.backend.lucene.types.codec.impl.LuceneByteVectorCodec
- All Implemented Interfaces:
LuceneFieldCodec<byte[],,byte[]> LuceneVectorFieldCodec<byte[]>
-
Field Summary
Fields inherited from class org.hibernate.search.backend.lucene.types.codec.impl.AbstractLuceneVectorFieldCodec
fieldType, log, vectorSimilarity -
Constructor Summary
ConstructorsConstructorDescriptionLuceneByteVectorCodec(org.apache.lucene.index.VectorSimilarityFunction vectorSimilarity, int dimension, Storage storage, Indexing indexing, byte[] indexNullAsValue, HibernateSearchKnnVectorsFormat knnVectorsFormat) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.index.IndexableFieldcreateIndexField(String absoluteFieldPath, byte[] value) byte[]decode(org.apache.lucene.index.IndexableField field) Extract the value from the given stored field.Class<byte[]>byte[]raw(org.apache.lucene.index.IndexableField field) floatsimilarityDistanceToScore(float distance) protected byte[]toByteArray(byte[] 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
-
LuceneByteVectorCodec
public LuceneByteVectorCodec(org.apache.lucene.index.VectorSimilarityFunction vectorSimilarity, int dimension, Storage storage, Indexing indexing, byte[] indexNullAsValue, HibernateSearchKnnVectorsFormat knnVectorsFormat)
-
-
Method Details
-
decode
public byte[] 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 byte[] raw(org.apache.lucene.index.IndexableField field) -
encodedType
- Returns:
- The type of the encoded value.
-
toByteArray
protected byte[] toByteArray(byte[] value) - Specified by:
toByteArrayin classAbstractLuceneVectorFieldCodec<byte[]>
-
createIndexField
protected org.apache.lucene.index.IndexableField createIndexField(String absoluteFieldPath, byte[] value) - Specified by:
createIndexFieldin classAbstractLuceneVectorFieldCodec<byte[]>
-
vectorEncoding
protected org.apache.lucene.index.VectorEncoding vectorEncoding()- Specified by:
vectorEncodingin classAbstractLuceneVectorFieldCodec<byte[]>
-
vectorElementsType
- Returns:
- The type of vector elements expected to get either
float.classorbyte.class.
-
similarityDistanceToScore
public float similarityDistanceToScore(float distance)
-