Class ScaNNQueryOptions (0.17.0)

ScaNNQueryOptions(
    num_leaves_to_search: int = 1,
    pre_reordering_num_neighbors: int = -1,
    pct_leaves_to_search: typing.Optional[float] = None,
)

Query options for ScaNN index.

Parameters

Name Description
num_leaves_to_search int

Number of leaves to search. 0 lets the server choose. Defaults to 1.

pre_reordering_num_neighbors int

Number of neighbors to return before reordering. -1 (the default) uses the server default. Must be an integer >= -1; the server enforces its own upper bound.

pct_leaves_to_search Optional[float]

Percentage (0-100, fractional values allowed) of leaves to search. When set, it is sent in addition to num_leaves_to_search; the server uses the percentage and falls back to num_leaves_to_search if the percentage resolves to zero leaves. Defaults to None (not sent).

Methods

to_parameter

to_parameter() -> list[str]

Convert index attributes to list of configurations.

to_string

to_string() -> str

Convert index attributes to string.

ScaNNQueryOptions

ScaNNQueryOptions(
    num_leaves_to_search: int = 1,
    pre_reordering_num_neighbors: int = -1,
    pct_leaves_to_search: typing.Optional[float] = None,
)

Query options for ScaNN index.

Parameters
Name Description
num_leaves_to_search int

Number of leaves to search. 0 lets the server choose. Defaults to 1.

pre_reordering_num_neighbors int

Number of neighbors to return before reordering. -1 (the default) uses the server default. Must be an integer >= -1; the server enforces its own upper bound.

pct_leaves_to_search Optional[float]

Percentage (0-100, fractional values allowed) of leaves to search. When set, it is sent in addition to num_leaves_to_search; the server uses the percentage and falls back to num_leaves_to_search if the percentage resolves to zero leaves. Defaults to None (not sent).