Package org.apache.lucene.codecs.hnsw
Class FlatVectorsFormat
- java.lang.Object
-
- org.apache.lucene.codecs.KnnVectorsFormat
-
- org.apache.lucene.codecs.hnsw.FlatVectorsFormat
-
- All Implemented Interfaces:
NamedSPILoader.NamedSPI
- Direct Known Subclasses:
Lucene99FlatVectorsFormat
,Lucene99ScalarQuantizedVectorsFormat
public abstract class FlatVectorsFormat extends KnnVectorsFormat
Encodes/decodes per-document vectors and provides a scoring interface for the flat stored vectors- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.codecs.KnnVectorsFormat
DEFAULT_MAX_DIMENSIONS, EMPTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FlatVectorsFormat(String name)
Sole constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract FlatVectorsReader
fieldsReader(SegmentReadState state)
Returns aKnnVectorsReader
to read the vectors from the index.abstract FlatVectorsWriter
fieldsWriter(SegmentWriteState state)
Returns aFlatVectorsWriter
to write the vectors to the index.int
getMaxDimensions(String fieldName)
Returns the maximum number of vector dimensions supported by this codec for the given field name-
Methods inherited from class org.apache.lucene.codecs.KnnVectorsFormat
availableKnnVectorsFormats, forName, getName, reloadKnnVectorsFormat
-
-
-
-
Constructor Detail
-
FlatVectorsFormat
protected FlatVectorsFormat(String name)
Sole constructor
-
-
Method Detail
-
fieldsWriter
public abstract FlatVectorsWriter fieldsWriter(SegmentWriteState state) throws IOException
Returns aFlatVectorsWriter
to write the vectors to the index.- Specified by:
fieldsWriter
in classKnnVectorsFormat
- Throws:
IOException
-
fieldsReader
public abstract FlatVectorsReader fieldsReader(SegmentReadState state) throws IOException
Returns aKnnVectorsReader
to read the vectors from the index.- Specified by:
fieldsReader
in classKnnVectorsFormat
- Throws:
IOException
-
getMaxDimensions
public int getMaxDimensions(String fieldName)
Description copied from class:KnnVectorsFormat
Returns the maximum number of vector dimensions supported by this codec for the given field nameCodecs should override this method to specify the maximum number of dimensions they support.
- Overrides:
getMaxDimensions
in classKnnVectorsFormat
- Parameters:
fieldName
- the field name- Returns:
- the maximum number of vector dimensions.
-
-