indexKey is optional in v0.17: SDK-supplied indexes (provider: none) must pass the exact 32-byte key used at creation, while KMS-backed indexes omit it — the service resolves the KEK via the stored KMSBlob.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | context.Context | Context for cancellation/timeouts |
indexName | string | Name of the existing index to load |
indexKey | []byte | (Optional) 32-byte encryption key used during index creation. Required for indexes created with the SDK-supplied KEK path (provider: none); pass nil or a zero-length slice for KMS-backed indexes. |
In v0.17
indexKey is optional. KMS-backed indexes (created with KmsName) omit it — the server resolves the DEK via the persisted KMSBlob. SDK-supplied indexes must re-supply the same 32-byte key here.Returns
| Type | Description |
|---|---|
*EncryptedIndex | Handle for performing vector operations on the loaded index |
error | Any error encountered during index loading |
Exceptions
Error
Error
- Returns error if the index doesn’t exist on the server
- Returns error if the encryption key is incorrect or invalid
- Returns error from the server if a KMS-backed index’s slot is unavailable
- Returns error if the server returns an HTTP error status
- Returns error if authentication fails (invalid API key)
Service Errors
Service Errors
- Throws if the CyborgDB service is unavailable or unreachable.
- Throws if there are internal server errors on the CyborgDB service.