v0.17 replaces the v0.16 getters (
getIndexType, getIndexConfig) with explicit methods for the single DiskIVF index type: getDimension, getMetric, and getNLists. Cached methods avoid repeat round-trips.getIndexName
Returns
Promise<string>: The unique name identifier of the index.
Example Usage
getDimension
- Returns the real dimension when
createIndexwas 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.
Returns
Promise<number>
Example Usage
getMetric
"euclidean", "squared_euclidean", or "cosine". Cached alongside dimension.
Returns
Promise<string>
Example Usage
getNLists
- Returns
1for untrained indexes. - Returns the trained cluster count after
train()completes.
getDimension / getMetric, this method is not cached — it fetches fresh on every call so callers reading immediately after training see the new value.
Returns
Promise<number>
Example Usage
isTrained
Returns
Promise<boolean>
Example Usage
isTraining
true if this index is currently being trained (or queued for training) on the server, false otherwise.
Under the hood this calls the global training-status endpoint and checks whether this index appears in the returned trainingIndexes list — so it always reflects the live server state and is not cached.
Returns
Promise<boolean>
Example Usage
Client.getHealth
Client (CyborgDB) instance.