Module org.apache.lucene.core
Class Lucene99FlatVectorsFormat
java.lang.Object
org.apache.lucene.codecs.KnnVectorsFormat
org.apache.lucene.codecs.hnsw.FlatVectorsFormat
org.apache.lucene.codecs.lucene99.Lucene99FlatVectorsFormat
- All Implemented Interfaces:
NamedSPILoader.NamedSPI
Lucene 9.9 flat vector format, which encodes numeric vector values
.vec (vector data) file
For each field:
- Vector data ordered by field, document ordinal, and vector dimension. When the vectorEncoding is BYTE, each sample is stored as a single byte. When it is FLOAT32, each sample is stored as an IEEE float in little-endian byte order.
- DocIds encoded by
IndexedDISI.writeBitSet(DocIdSetIterator, IndexOutput, byte)
, note that only in sparse case - OrdToDoc was encoded by
DirectMonotonicWriter
, note that only in sparse case
.vemf (vector metadata) file
For each field:
- [int32] field number
- [int32] vector similarity function ordinal
- [vlong] offset to this field's vectors in the .vec file
- [vlong] length of this field's vectors, in bytes
- [vint] dimension of this field's vectors
- [int] the number of documents having values for this field
- [int8] if equals to -2, empty - no vector values. If equals to -1, dense – all documents have values for a field. If equals to 0, sparse – some documents missing values.
- DocIds were encoded by
IndexedDISI.writeBitSet(DocIdSetIterator, IndexOutput, byte)
- OrdToDoc was encoded by
DirectMonotonicWriter
, note that only in sparse case
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
private final FlatVectorsScorer
static final int
static final int
Fields inherited from class org.apache.lucene.codecs.KnnVectorsFormat
DEFAULT_MAX_DIMENSIONS, EMPTY
-
Constructor Summary
ConstructorsConstructorDescriptionLucene99FlatVectorsFormat
(FlatVectorsScorer vectorsScorer) Constructs a format -
Method Summary
Modifier and TypeMethodDescriptionfieldsReader
(SegmentReadState state) Returns aKnnVectorsReader
to read the vectors from the index.fieldsWriter
(SegmentWriteState state) Returns aFlatVectorsWriter
to write the vectors to the index.toString()
Methods inherited from class org.apache.lucene.codecs.hnsw.FlatVectorsFormat
getMaxDimensions
Methods inherited from class org.apache.lucene.codecs.KnnVectorsFormat
availableKnnVectorsFormats, forName, getName, reloadKnnVectorsFormat
-
Field Details
-
NAME
- See Also:
-
META_CODEC_NAME
- See Also:
-
VECTOR_DATA_CODEC_NAME
- See Also:
-
META_EXTENSION
- See Also:
-
VECTOR_DATA_EXTENSION
- See Also:
-
VERSION_START
public static final int VERSION_START- See Also:
-
VERSION_CURRENT
public static final int VERSION_CURRENT- See Also:
-
DIRECT_MONOTONIC_BLOCK_SHIFT
static final int DIRECT_MONOTONIC_BLOCK_SHIFT- See Also:
-
vectorsScorer
-
-
Constructor Details
-
Lucene99FlatVectorsFormat
Constructs a format
-
-
Method Details
-
fieldsWriter
Description copied from class:FlatVectorsFormat
Returns aFlatVectorsWriter
to write the vectors to the index.- Specified by:
fieldsWriter
in classFlatVectorsFormat
- Throws:
IOException
-
fieldsReader
Description copied from class:FlatVectorsFormat
Returns aKnnVectorsReader
to read the vectors from the index.- Specified by:
fieldsReader
in classFlatVectorsFormat
- Throws:
IOException
-
toString
-