search_additional_params
API Definition
def search_additional_params (adp_threshold: float, adp_refined: int, leaves_to_search: int) -> bool
Function
Extends ScaNN functionality with custom search parameters (KScaNN-specific addition). The API parameter settings can be cached and apply to the subsequent search; therefore, set this API after index build and before search.
Parameters
Parameter |
Description |
Data Type |
Value Range |
|---|---|---|---|
adp_threshold |
Decision threshold. The typical value is 0.3. |
float |
[0.1, 0.8] |
adp_refined |
Number of subspaces used by a simple query. The typical value is 0, which is an adaptive training value (the third quantile). |
int |
[0, leaves_to_search], where leaves_to_search indicates the number of subspaces used by the complex query. |
leaves_to_search |
Number of subspaces used by a complex query. The value must be consistent with that of the search* API. |
int |
[1, num_leaves], where num_leaves indicates the total number of subspaces in the IVF index partition. |
Return Value
Data Type |
Description |
|---|---|
bool |
If the algorithm library is loaded successfully, True is returned when the function is activated based on the settings. Otherwise, False is returned. |