Class Lucene90OnHeapHnswGraph
- java.lang.Object
-
- org.apache.lucene.util.hnsw.HnswGraph
-
- org.apache.lucene.backward_codecs.lucene90.Lucene90OnHeapHnswGraph
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.util.hnsw.HnswGraph
HnswGraph.ArrayNodesIterator, HnswGraph.CollectionNodesIterator, HnswGraph.NodesIterator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
entryNode()
Lucene90NeighborArray
getNeighbors(int node)
Returns theNeighborQueue
connected to the given node.HnswGraph.NodesIterator
getNodesOnLevel(int level)
int
nextNeighbor()
int
numLevels()
static NeighborQueue
search(float[] query, int topK, int numSeed, RandomAccessVectorValues.Floats vectors, VectorSimilarityFunction similarityFunction, HnswGraph graphValues, Bits acceptOrds, long visitedLimit, SplittableRandom random)
Searches for the nearest neighbors of a query vector.void
seek(int level, int targetNode)
int
size()
-
-
-
Method Detail
-
search
public static NeighborQueue search(float[] query, int topK, int numSeed, RandomAccessVectorValues.Floats vectors, VectorSimilarityFunction similarityFunction, HnswGraph graphValues, Bits acceptOrds, long visitedLimit, SplittableRandom random) throws IOException
Searches for the nearest neighbors of a query vector.- Parameters:
query
- search query vectortopK
- the number of nodes to be returnednumSeed
- the size of the queue maintained while searching, and controls the number of random entry points to samplevectors
- vector valuesgraphValues
- the graph values. May represent the entire graph, or a level in a hierarchical graph.acceptOrds
-Bits
that represents the allowed document ordinals to match, ornull
if they are all allowed to match.random
- a source of randomness, used for generating entry points to the graph- Returns:
- a priority queue holding the closest neighbors found
- Throws:
IOException
-
getNeighbors
public Lucene90NeighborArray getNeighbors(int node)
Returns theNeighborQueue
connected to the given node.- Parameters:
node
- the node whose neighbors are returned
-
nextNeighbor
public int nextNeighbor()
- Specified by:
nextNeighbor
in classHnswGraph
-
getNodesOnLevel
public HnswGraph.NodesIterator getNodesOnLevel(int level)
- Specified by:
getNodesOnLevel
in classHnswGraph
-
-