Class IVFVectorsFormat

java.lang.Object
org.apache.lucene.codecs.KnnVectorsFormat
org.elasticsearch.index.codec.vectors.IVFVectorsFormat
All Implemented Interfaces:
org.apache.lucene.util.NamedSPILoader.NamedSPI

public class IVFVectorsFormat extends org.apache.lucene.codecs.KnnVectorsFormat
Codec format for Inverted File Vector indexes. This index expects to break the dimensional space into clusters and assign each vector to a cluster generating a posting list of vectors. Clusters are represented by centroids. The vector quantization format used here is a per-vector optimized scalar quantization. Also see OptimizedScalarQuantizer. Some of key features are: The format is stored in three files:

.cenivf (centroid data) file

Which stores the raw and quantized centroid vectors.

.clivf (cluster data) file

Stores the quantized vectors for each cluster, inline and stored in blocks. Additionally, the docIds of each vector is stored.

.mivf (centroid metadata) file

Stores metadata including the number of centroids and their offsets in the clivf file

  • Field Details

  • Constructor Details

    • IVFVectorsFormat

      public IVFVectorsFormat(int vectorPerCluster)
    • IVFVectorsFormat

      public IVFVectorsFormat()
      Constructs a format using the given graph construction parameters and scalar quantization.
  • Method Details

    • fieldsWriter

      public org.apache.lucene.codecs.KnnVectorsWriter fieldsWriter(org.apache.lucene.index.SegmentWriteState state) throws IOException
      Specified by:
      fieldsWriter in class org.apache.lucene.codecs.KnnVectorsFormat
      Throws:
      IOException
    • fieldsReader

      public org.apache.lucene.codecs.KnnVectorsReader fieldsReader(org.apache.lucene.index.SegmentReadState state) throws IOException
      Specified by:
      fieldsReader in class org.apache.lucene.codecs.KnnVectorsFormat
      Throws:
      IOException
    • getMaxDimensions

      public int getMaxDimensions(String fieldName)
      Specified by:
      getMaxDimensions in class org.apache.lucene.codecs.KnnVectorsFormat
    • toString

      public String toString()
      Overrides:
      toString in class Object