index_config parameter to choose between index variants.
All parameters after
index_key are keyword-only.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
index_name | str | - | Name of the index to create. Must be unique. |
index_key | bytes | - | 32-byte encryption key (KEK) for the index, used to secure the index data. |
dimension | int | None | None | (Optional, keyword-only) Dimensionality of vector embeddings. When None, auto-detected from the first upsert (or derived from embedding_model). |
storage_precision | np.float32 | np.float16 | np.float32 | (Optional, keyword-only) On-disk dtype for the rerank vectors. np.float16 (or "float16") halves the disk footprint with a slight precision loss. See storage precision. |
embedding_model | str | None | None | (Optional, keyword-only) Name of the SentenceTransformer model to use for automatic text embeddings. |
metric | str | None | "euclidean" | (Optional, keyword-only) Distance metric to use: "euclidean", "cosine", or "squared_euclidean". See DistanceMetric. |
logger | Logger | None | (Optional, keyword-only) Logger instance for capturing operation logs. |
For more info on auto-generating embeddings, refer to Auto-Generate Embeddings.
Returns
EncryptedIndex: An instance of the newly created encrypted index.
Exceptions
ValueError
ValueError
- Throws if the index name is not unique.
- Throws if the index configuration is invalid.
- Throws if the index could not be created.