Rate This Document
Findability
Accuracy
Completeness
Readability

search_batched_parallel

API Definition

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

Function

Perform parallel batch-query search, which is concurrently executed by multiple threads. It adds a new parameter batch_size to the open source algorithm API.

Parameters

Parameter

Description

Data Type

Value Range

queries

Queries in a batch.

numpy.ndarray

The value cannot be null.

final_num_neighbors

Number of returned results (Top K).

int

[1, number_of_base_libraries]

pre_reorder_num_neighbors

Number of results saved before reordering.

int

[final_num_neighbors, number_of_base_libraries]

leaves_to_search

Number of subspaces to be searched.

int

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

batch_size

Size of the preferred batch during automatic batching in parallel mode. The default value is 256.

int

≥ 1

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.