API documentation for indexes module.
Classes
IVFIndex
IVFIndex(name: Optional[str] = None, index_type: str = 'ivf', distance_strategy: langchain_postgres.v2.indexes.DistanceStrategy = <factory>, partial_indexes: Optional[list[str]] = None, extension_name: Optional[str] = None, lists: int = 100)IVFIndex(name: Optional[str] = None, index_type: str = 'ivf', distance_strategy: langchain_postgres.v2.indexes.DistanceStrategy =
IVFQueryOptions
IVFQueryOptions(probes: int = 1)IVFQueryOptions(probes: int = 1)
ScaNNIndex
ScaNNIndex(name: typing.Optional[str] = None, index_type: str = 'ScaNN', distance_strategy: langchain_postgres.v2.indexes.DistanceStrategy = <factory>, partial_indexes: typing.Optional[list[str]] = None, extension_name: str = 'alloydb_scann', num_leaves: int = 5, *, mode: typing.Optional[str] = None)ScaNN index configuration for AlloyDB.
| Parameters | |
|---|---|
| Name | Description |
num_leaves |
int
Number of partitions. Used when |
mode |
Optional[str]
Keyword-only. |
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. |
pre_reordering_num_neighbors |
int
Number of neighbors to return before reordering. |
pct_leaves_to_search |
Optional[float]
Percentage (0-100, fractional values allowed) of leaves to search. When set, it is sent in addition to |
Modules Functions
_is_int
_is_int(value: object) -> boolTrue for integers (including numpy integers), excluding bools.