HnswGraph
Hierarchical Navigable Small World graph. Provides efficient approximate nearest neighbor search for high dimensional vectors. See Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs 2018 paper for details.
The nomenclature is a bit different here from what's used in the paper:
Hyperparameters
beamWidthin HnswGraphBuilder has the same meaning asefConst* in the paper. It is the number of nearest neighbor candidates to track while searching the graph for each newly inserted node.maxConnhas the same meaning asMin the paper; it controls how many of theefConstneighbors are connected to the new node
Note: The graph may be searched by multiple threads concurrently, but updates are not thread-safe. The search method optionally takes a set of "accepted nodes", which can be used to exclude deleted documents.
Inheritors
Types
NodesIterator that accepts nodes as an integer array.
Nodes iterator based on set representation of nodes.
Iterator over the graph nodes on a certain level. Iterator also provides the size – the total number of nodes to be iterated over. The nodes are NOT guaranteed to be presented in any particular order.
Functions
Get all nodes on a given level as node 0th ordinals. The nodes are NOT guaranteed to be presented in any particular order.
Iterates over the neighbor list. It is illegal to call this method after it returns NO_MORE_DOCS without calling .seek, which resets the iterator.