Encodes/decodes per-document vector and any associated indexing structures required to support nearest-neighbor search
| constant | type | note |
|---|---|---|
| DEFAULT_MAX_DIMENSIONS | int | The maximum number of vector dimensions |
| EMPTY | KnnVectorsFormat | EMPTY throws an exception when written. It acts as a sentinel indicating a Codec that does not support vectors. |
availableKnnVectorsFormats()returns a list of all available format names
looks up a format by name
reloadKnnVectorsFormat(ClassLoader classloader)Reloads the KnnVectorsFormat list from the given ClassLoader.
NOTE: Only new KnnVectorsFormat are added, existing ones are never removed or replaced.
This method is expensive and should only be called for discovery of new KnnVectorsFormat on the given classpath/classloader!
fieldsReader(org.apache.lucene.index.SegmentReadState state)Returns a KnnVectorsReader to read the vectors from the index.
fieldsWriter(org.apache.lucene.index.SegmentWriteState state)Returns a KnnVectorsWriter to write the vectors to the index.
getMaxDimensions(String fieldName)Returns the maximum number of vector dimensions supported by this codec for the given field name
Codecs implement this method to specify the maximum number of dimensions they support.
| name | type | description |
|---|---|---|
| field_name | String | the field name |
Returns: the maximum number of vector dimensions.
getName() · also: get_name