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

search_batched

API Definition

def search_batched(queries: numpy.ndarray, final_num_neighbors: int, pre_reorder_num_neighbors: int, leaves_to_search: int) -> tuple(index, distance)

Function

Batch query search (single-thread behavior consistent with the open source algorithm).

Parameters

Parameter

Data Type

Description

Value Range

queries

numpy.ndarray

Queries in a batch.

The value cannot be null.

final_num_neighbors

int

Number of returned results.

≥ 1

pre_reorder_num_neighbors

int

Number of results saved before reordering.

final_num_neighbors, where final_num_neighbors indicates the number of results returned.

leaves_to_search

int

Number of subspaces to be searched.

[1, num_leaves], where num_leaves indicates the total number of subspaces in the IVF index partition.

Return Value

Data Type

Description

tuple(index, distance)

index is the numpy.ndarray type data that contains final_num_neighbors base library IDs. distance is the numpy.ndarray type data that contains final_num_neighbors distances.