Loads an existing encrypted index and returns an instance of EncryptedIndex.

def load_index(self, index_name: str, index_key: bytes, max_cache_size: int = 0)

Parameters

ParameterTypeDescription
index_namestrName of the index to load.
index_keybytes32-byte encryption key; must match the key used during create_index().
max_cache_sizeint(Optional) Maximum size of local cache to keep for encrypted index. Defaults to 0.

Returns

EncryptedIndex: An instance of the loaded encrypted index.

Exceptions

Example Usage

import cyborg_vector_search_py as cvs

index_location = cvs.DBConfig(location='redis', connection_string="redis://localhost")
config_location = cvs.DBConfig(location='redis', connection_string="redis://localhost")

client = cvs.Client(index_location=index_location, config_location=config_location)

index_name = "my_index"
index_key = my_index_key  # Use the same 32-byte encryption key used during index creation

# Load the existing index
index = client.load_index(index_name=index_name, index_key=index_key)