getIndexName
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
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
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
Returns
Promise<IndexIVFFlat>
: For IVF Flat indexesPromise<IndexIVF>
: For standard IVF indexesPromise<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)
Property | Type | Description |
---|---|---|
dimension | number | Vector dimensionality |
IVFPQ-Specific Properties
Property | Type | Description |
---|---|---|
pqDim | number | Product quantization dimension |
pqBits | number | Number of bits for quantization |
isTraining
Returns
Promise<object>
: A Promise that resolves to an object containing:
training_indexes
: Array of index names that are currently being trainedretrain_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