Package org.apache.lucene.codecs
Class KnnVectorsFormat
- java.lang.Object
-
- org.apache.lucene.codecs.KnnVectorsFormat
-
- All Implemented Interfaces:
NamedSPILoader.NamedSPI
- Direct Known Subclasses:
Lucene90HnswVectorsFormat
,PerFieldKnnVectorsFormat
public abstract class KnnVectorsFormat extends Object implements NamedSPILoader.NamedSPI
Encodes/decodes per-document vector and any associated indexing structures required to support nearest-neighbor search
-
-
Field Summary
Fields Modifier and Type Field Description static KnnVectorsFormat
EMPTY
EMPTY throws an exception when written.
-
Constructor Summary
Constructors Modifier Constructor Description protected
KnnVectorsFormat(String name)
Sole constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract KnnVectorsReader
fieldsReader(SegmentReadState state)
Returns aKnnVectorsReader
to read the vectors from the index.abstract KnnVectorsWriter
fieldsWriter(SegmentWriteState state)
Returns aKnnVectorsWriter
to write the vectors to the index.static KnnVectorsFormat
forName(String name)
looks up a format by nameString
getName()
-
-
-
Field Detail
-
EMPTY
public static final KnnVectorsFormat EMPTY
EMPTY throws an exception when written. It acts as a sentinel indicating a Codec that does not support vectors.
-
-
Constructor Detail
-
KnnVectorsFormat
protected KnnVectorsFormat(String name)
Sole constructor
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceNamedSPILoader.NamedSPI
-
forName
public static KnnVectorsFormat forName(String name)
looks up a format by name
-
fieldsWriter
public abstract KnnVectorsWriter fieldsWriter(SegmentWriteState state) throws IOException
Returns aKnnVectorsWriter
to write the vectors to the index.- Throws:
IOException
-
fieldsReader
public abstract KnnVectorsReader fieldsReader(SegmentReadState state) throws IOException
Returns aKnnVectorsReader
to read the vectors from the index.- Throws:
IOException
-
-