Rate This Document
Findability
Accuracy
Completeness
Readability

SearchAdditionalParams

API Definition

int ScannInterface::SearchAdditionalParams(float adp_threshold, int adp_refined, int leaves_to_search);

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

int

If the algorithm library is loaded successfully, 0 is returned when the function is activated based on the settings. Otherwise, -1 is returned.