Loads and returns an existing EncryptedIndex instance based on its name and key.
client.load_index(
    index_name,
    index_key
)

Parameters

ParameterTypeDescription
index_namestrName of an existing index
index_keybytes32-byte encryption key
The encryption key must exactly match the key used during index creation.

Exceptions

Returns

An instance of EncryptedIndex if the index exists and the key is valid.

Exceptions

Example Usage

Basic usage of the load_index method to retrieve an existing index:
from cyborgdb import Client

# Create a client
client = Client(base_url='http://localhost:8000', api_key='your-api-key')

# Provide the same index key used when creating the index
index_key = your_existing_32_byte_key

# Connect to existing index
index = client.load_index("my_index", index_key)