v0.17 replaces the v0.16 getters (
index_type, index_config) with explicit properties for the single DiskIVF index type: dimension, metric, and n_lists. Most are lazily fetched and cached on first read.index_name
Example Usage
dimension
- Returns the real dimension when
create_indexwas called with an explicitdimension, or after the first upsert (auto-detect). - Returns
0if the index was created with auto-detect AND no upsert has happened yet.
Example Usage
metric
"euclidean", "squared_euclidean", or "cosine". Cached on first read alongside dimension.
Example Usage
n_lists
- Returns
1for untrained indexes. - Returns the trained cluster count after
train()completes.
dimension and metric, n_lists is fetched fresh on every read so callers reading immediately after training see the new value.
Example Usage
is_trained
Returns
bool: True if the index has been trained, False otherwise (or if the underlying describe call fails).
Example Usage
is_training
Returns
bool: True if the index is currently training or queued, False otherwise.