Package org.apache.lucene.util.hnsw
Navigable Small-World graph, nominally Hierarchical but currently only has a single layer.
Provides efficient approximate nearest neighbor search for high dimensional vectors.
-
Interface Summary Interface Description IntToIntFunction Native int to int functionRandomAccessVectorValues<T> Provides random access to vectors by dense ordinal.RandomVectorScorer ARandomVectorScorer
for scoring random nodes in batches against an abstract query.RandomVectorScorerSupplier A supplier that createsRandomVectorScorer
from an ordinal. -
Class Summary Class Description HnswGraph Hierarchical Navigable Small World graph.HnswGraph.ArrayNodesIterator NodesIterator that accepts nodes as an integer array.HnswGraph.CollectionNodesIterator Nodes iterator based on set representation of nodes.HnswGraph.NodesIterator Iterator over the graph nodes on a certain level, Iterator also provides the size – the total number of nodes to be iterated over.HnswGraphBuilder Builder for HNSW graph.HnswGraphBuilder.GraphBuilderKnnCollector A restricted, specialized knnCollector that can be used when building a graph.HnswGraphSearcher Searches an HNSW graph to find nearest neighbors to a query vector.NeighborArray NeighborArray encodes the neighbors of a node and their mutual scores in the HNSW graph as a pair of growable arrays.NeighborQueue NeighborQueue uses aLongHeap
to store lists of arcs in an HNSW graph, represented as a neighbor node id with an associated score packed together as a sortable long, which is sorted primarily by score.OnHeapHnswGraph AnHnswGraph
where all nodes and connections are held in memory.OrdinalTranslatedKnnCollector Wraps a provided KnnCollector object, translating the provided vectorId ordinal to a documentId