Rate This Document
Findability
Accuracy
Completeness
Readability

search_additional_params

API Definition

def search_additional_params (adp_threshold: float, refine_prm: float, adp_refined: int, leaves_to_search: int) -> bool

Function

Extends ScaNN functionality with custom search parameters (KScaNN-specific API). 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

Data Type

Description

Value Range

adp_threshold

float

Decision threshold. The typical value is 0.3.

[0.1, 0.8]

refine_prm

float

Fine-grained control over the filtering strategy. The typical value is 0.2. A larger value reduces the number of subspaces to be filtered, which increases accuracy but degrades performance.

[0.0, 1.0]. The default value is 0.0.

adp_refined

int

Number of subspaces used by a simple query. The typical value is 0, which is an adaptive training value (the third quantile).

[0, leaves_to_search], where leaves_to_search indicates the number of subspaces used by the complex query.

leaves_to_search

int

Number of subspaces used by a complex query. The value must be consistent with that of the search* API.

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