Parameters
Parameter | Type | Description |
---|---|---|
index_name | std::string | Name of the index to create (must be unique). |
index_key | std::array<uint8_t, 32> | 32-byte encryption key for the index, used to secure index data. |
index_config | IndexConfig | (Optional in overload 2) Configuration for the index type. When not provided, uses IndexIVFFlat defaults. |
max_cache_size | std::optional<size_t> | (Optional) Maximum size for the local cache in megabytes (default is 0 ). |
metric | std::optional<DistanceMetric> | (Optional) Distance metric to override the one set in index_config (default is std::nullopt ). |
logger | cyborg::Logger* | (Optional) Pointer to a logger instance for capturing operation logs (default is nullptr ). |
Returns
std::unique_ptr<cyborg::EncryptedIndex>
: A pointer to the newly created index (EncryptedIndex
).
Exceptions
std::invalid_argument
std::invalid_argument
- Throws if the index name is not unique.
- Throws if the index configuration is invalid.
std::runtime_exception
std::runtime_exception
- Throws if the index could not be created.