我要评分
获取效率
正确性
完整性
易理解

search

API Definition

def search(nq: int, xq: numpy.ndarray, topk: int, distances: numpy.ndarray, labels: numpy.ndarray, num_threads: int) -> int

Function

Searches for a graph.

Parameters

Parameter

Data Type

Description

Value Range

nq

int

Data volume of the query vector set.

≥ 1. It is recommended that the value be less than 1 billion.

xq

numpy.ndarray

Query vector set data.

The value cannot be null. The expected length is nq × dim (data volume × feature dimension).

topk

int

Number of nearest neighbors.

[1, nb], where nb indicates the data volume of the vector base library.

distances

numpy.ndarray

Distance array.

The value cannot be null. The expected length is nq × topk.

labels

numpy.ndarray

ID array of the search result.

The value cannot be null. The expected length is nq × topk.

num_threads

int

Number of threads used for search.

[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.