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 protectedFlatVectorsFormat(String name)Sole constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract FlatVectorsReaderfieldsReader(SegmentReadState state)Returns aKnnVectorsReaderto read the vectors from the index.abstract FlatVectorsWriterfieldsWriter(SegmentWriteState state)Returns aFlatVectorsWriterto write the vectors to the index.intgetMaxDimensions(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 aFlatVectorsWriterto write the vectors to the index.- Specified by:
fieldsWriterin classKnnVectorsFormat- Throws:
IOException
-
fieldsReader
public abstract FlatVectorsReader fieldsReader(SegmentReadState state) throws IOException
Returns aKnnVectorsReaderto read the vectors from the index.- Specified by:
fieldsReaderin classKnnVectorsFormat- Throws:
IOException
-
getMaxDimensions
public int getMaxDimensions(String fieldName)
Description copied from class:KnnVectorsFormatReturns 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:
getMaxDimensionsin classKnnVectorsFormat- Parameters:
fieldName- the field name- Returns:
- the maximum number of vector dimensions.
-
-