Class LateInteractionField
- All Implemented Interfaces:
IndexableField
The value is stored as a binary payload, and can be retrieved using decode(BytesRef)
. Multi-vectors are expected to have the same dimension for
each composing token vector. This is stored along with the token vectors in the first 4 bytes of
the payload.
Note: This field does not ensure consistency in token vector dimensions for values across documents.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.document.Field
Field.Store
-
Field Summary
Fields inherited from class org.apache.lucene.document.BinaryDocValuesField
TYPE
Fields inherited from class org.apache.lucene.document.Field
fieldsData, name, type
-
Constructor Summary
ConstructorsConstructorDescriptionLateInteractionField
(String name, float[][] value) Creates a newLateInteractionField
from the provided multi-vector matrix. -
Method Summary
Modifier and TypeMethodDescriptionstatic float[][]
Decodes providedBytesRef
into a multi-vector matrix.static BytesRef
encode
(float[][] value) Encodes provided multi-vector matrix into aBytesRef
that can be stored in theLateInteractionField
.float[][]
getValue()
Returns the multi-vector value stored in this fieldvoid
setValue
(float[][] value) Set multi-vector value for the field.Methods inherited from class org.apache.lucene.document.Field
binaryValue, fieldType, getCharSequenceValue, invertableType, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, storedValue, stringValue, tokenStream, tokenStreamValue, toString
-
Constructor Details
-
LateInteractionField
Creates a newLateInteractionField
from the provided multi-vector matrix.- Parameters:
name
- field namevalue
- multi-vector value
-
-
Method Details
-
setValue
public void setValue(float[][] value) Set multi-vector value for the field.Value should not be null or empty. Composing token vectors for provided multi-vector value should have the same dimension.
-
getValue
public float[][] getValue()Returns the multi-vector value stored in this field -
encode
Encodes provided multi-vector matrix into aBytesRef
that can be stored in theLateInteractionField
.Composing token vectors for the multi-vector are expected to have the same dimension, which is stored along with the token vectors in the first 4 bytes of the payload. Use
decode(BytesRef)
to retrieve the multi-vector.- Parameters:
value
- Multi-Vector to encode- Returns:
- BytesRef representation for provided multi-vector
-
decode
Decodes providedBytesRef
into a multi-vector matrix.The token vectors are expected to have the same dimension, which is stored along with the token vectors in the first 4 bytes of the payload. Meant to be used as a counterpart to
encode(float[][])
- Parameters:
payload
- to decode into multi-vector value- Returns:
- decoded multi-vector value
-