Class Lucene104HnswScalarQuantizedVectorsFormat

java.lang.Object
org.apache.lucene.codecs.KnnVectorsFormat
org.apache.lucene.codecs.lucene104.Lucene104HnswScalarQuantizedVectorsFormat
All Implemented Interfaces:
NamedSPILoader.NamedSPI

public class Lucene104HnswScalarQuantizedVectorsFormat extends KnnVectorsFormat
A vectors format that uses HNSW graph to store and search for vectors. But vectors are binary quantized using Lucene104ScalarQuantizedVectorsFormat before being stored in the graph.
  • Field Details

  • Constructor Details

    • Lucene104HnswScalarQuantizedVectorsFormat

      public Lucene104HnswScalarQuantizedVectorsFormat()
      Constructs a format using default graph construction parameters
    • Lucene104HnswScalarQuantizedVectorsFormat

      public Lucene104HnswScalarQuantizedVectorsFormat(int maxConn, int beamWidth)
      Constructs a format using the given graph construction parameters.
      Parameters:
      maxConn - the maximum number of connections to a node in the HNSW graph
      beamWidth - the size of the queue maintained during graph construction.
    • Lucene104HnswScalarQuantizedVectorsFormat

      public Lucene104HnswScalarQuantizedVectorsFormat(Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding encoding, int maxConn, int beamWidth)
      Constructs a format using the given graph construction parameters.
      Parameters:
      encoding - the quantization encoding used to encode the vectors
      maxConn - the maximum number of connections to a node in the HNSW graph
      beamWidth - the size of the queue maintained during graph construction.
    • Lucene104HnswScalarQuantizedVectorsFormat

      public Lucene104HnswScalarQuantizedVectorsFormat(Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding encoding, int maxConn, int beamWidth, int numMergeWorkers, ExecutorService mergeExec)
      Constructs a format using the given graph construction parameters and scalar quantization.
      Parameters:
      encoding - the quantization encoding used to encode the vectors
      maxConn - the maximum number of connections to a node in the HNSW graph
      beamWidth - the size of the queue maintained during graph construction.
      numMergeWorkers - number of workers (threads) that will be used when doing merge. If larger than 1, a non-null ExecutorService must be passed as mergeExec
      mergeExec - the ExecutorService that will be used by ALL vector writers that are generated by this format to do the merge
    • Lucene104HnswScalarQuantizedVectorsFormat

      public Lucene104HnswScalarQuantizedVectorsFormat(Lucene104ScalarQuantizedVectorsFormat.ScalarEncoding encoding, int maxConn, int beamWidth, int numMergeWorkers, ExecutorService mergeExec, int tinySegmentsThreshold)
      Constructs a format using the given graph construction parameters and scalar quantization.
      Parameters:
      maxConn - the maximum number of connections to a node in the HNSW graph
      beamWidth - the size of the queue maintained during graph construction.
      numMergeWorkers - number of workers (threads) that will be used when doing merge. If larger than 1, a non-null ExecutorService must be passed as mergeExec
      mergeExec - the ExecutorService that will be used by ALL vector writers that are generated by this format to do the merge
  • Method Details