Skip to main content

getIndexName

Retrieves the name of the encrypted index from the CyborgDB service.

Returns

Promise<string>: A Promise that resolves to the unique name identifier of the index.

Exceptions

  • Throws if the API request fails due to network connectivity issues
  • Throws if authentication fails (invalid API key or encryption key)
  • Throws if the index doesn’t exist on the server

Example Usage


getIndexType

Retrieves the type of the index from the CyborgDB service.

Returns

Promise<string | undefined>: A Promise that resolves to the index type ('ivf', 'ivf_flat', or 'ivf_pq'), or undefined if not set.

Exceptions

  • Throws if the API request fails due to network connectivity issues
  • Throws if authentication fails (invalid API key or encryption key)
  • Throws if the index doesn’t exist on the server

Example Usage


isTrained

Checks whether the index has been trained by querying the CyborgDB service. Training is required for optimal query performance on IVF-based indexes.

Returns

Promise<boolean>: A Promise that resolves to true if the index has been trained, false otherwise.

Exceptions

  • Throws if the API request fails due to network connectivity issues
  • Throws if authentication fails (invalid API key or encryption key)
  • Throws if the index doesn’t exist on the server

Example Usage


getIndexConfig

Retrieves the complete index configuration from the CyborgDB service and returns a copy to prevent external modification of the internal state. The return type depends on the index type.

Returns

  • Promise<IndexIVFFlat>: For IVF Flat indexes
  • Promise<IndexIVF>: For standard IVF indexes
  • Promise<IndexIVFPQ>: For IVF PQ indexes

Exceptions

  • Throws if the API request fails due to network connectivity issues
  • Throws if authentication fails (invalid API key or encryption key)
  • Throws if the index doesn’t exist on the server

Example Usage

Configuration Properties

Common Properties (All Index Types)

IVFPQ-Specific Properties


isTraining

Checks if any indexes are currently being trained on the CyborgDB service. This is a Client method, not an EncryptedIndex method.

Returns

Promise<object>: A Promise that resolves to an object containing:
  • training_indexes: Array of index names that are currently being trained
  • retrain_threshold: The multiplier used for the retraining threshold

Exceptions

  • Throws if the API request fails due to network connectivity issues
  • Throws if authentication fails (invalid API key)
  • Throws if the server returns an error response

Example Usage