search
API Definition
def search(n: int, query: numpy.ndarray, k: int, distances: numpy.ndarray, labels: numpy.ndarray, num_threads: int) -> int
Function
Searches for a graph.
Parameters
Parameter |
Description |
Data Type |
Value Range |
|---|---|---|---|
n |
Data volume. |
int |
≥ 1. It is recommended that the value be less than 1 billion. |
query |
Data. |
numpy.ndarray |
The value cannot be null. The expected length is n × K_features (Data volume × Feature dimension). |
k |
Number of nearest neighbors. |
int |
[1, n], where n indicates the data volume. |
distances |
Distance array. |
numpy.ndarray |
The value cannot be null. The expected length is n × K_features. |
labels |
ID array of the search result. |
numpy.ndarray |
The value cannot be null. The expected length is n × K_features. |
num_threads |
Number of threads used for search. |
int |
[1,std::thread::hardware_concurrency()], where std::thread::hardware_concurrency() indicates the number of concurrent threads supported by the current system. |
Return Value
Data Type |
Description |
|---|---|
int |
This API is a wrapper for an underlying C++ API, which controls exception handling. |