Rate This Document
Findability
Accuracy
Completeness
Readability

search

API Definition

def search(n: int, query: numpy.ndarray, k: int, num_threads: int) -> int

Function

Search 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()]

Return Value

Data Type

Description

int

The API is encapsulated by the underlying C++ API, which controls the exception throwing.