Class HnswBitVectorsFormat

  • All Implemented Interfaces:
    NamedSPILoader.NamedSPI

    public final class HnswBitVectorsFormat
    extends KnnVectorsFormat
    Encodes bit vector values into an associated graph connecting the documents having values. The graph is used to power HNSW search. The format consists of two files, and uses Lucene99FlatVectorsFormat to store the actual vectors, but with a custom scorer implementation: For details on graph storage and file extensions, see Lucene99HnswVectorsFormat.
    • Constructor Detail

      • HnswBitVectorsFormat

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

        public HnswBitVectorsFormat​(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.
      • HnswBitVectorsFormat

        public HnswBitVectorsFormat​(int maxConn,
                                    int beamWidth,
                                    int numMergeWorkers,
                                    java.util.concurrent.ExecutorService mergeExec)
        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