Skip to main content
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 the name of the encrypted index. Known at construction — no API call.

Returns

Promise<string>: The unique name identifier of the index.

Example Usage


getDimension

Vector dimensionality.
  • Returns the real dimension when createIndex was called with an explicit dimension, or after the first upsert (auto-detect).
  • Returns 0 if the index was created with auto-detect AND no upsert has happened yet.
Cached on first read; subsequent reads do not hit the server.

Returns

Promise<number>

Example Usage


getMetric

Distance metric: "euclidean", "squared_euclidean", or "cosine". Cached alongside dimension.

Returns

Promise<string>

Example Usage


getNLists

Number of inverted lists in the IVF index.
  • Returns 1 for untrained indexes.
  • Returns the trained cluster count after train() completes.
Unlike 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 whether the index has been trained. Not cached — training status can change server-side via auto-training.

Returns

Promise<boolean>

Example Usage


isTraining

Returns 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

Returns the service health status. Useful for liveness checks and CI smoke tests. Available on the Client (CyborgDB) instance.

Example Usage


Client.generateKey

Generates a cryptographically secure 32-byte (256-bit) encryption key suitable for SDK-supplied index creation. Both forms exist for convenience — use the static form when you do not yet have a client instance.

Example Usage