id, then it will be overwritten.
Parameters
| Parameter | Type | Description |
|---|---|---|
ids | std::vector<cyborg::ItemID>& | Unique identifiers for each vector. |
vectors | Array2D<float> | 2D container with vector embeddings to index. |
contents | std::vector<std::vector<uint8_t>>& | Item contents in bytes. Pass {} if none. |
json_metadata_array | std::vector<std::string>& | Item metadata as serialized JSON strings. Pass {} if none. |
key | KeyContext | Key context for the operation. A bare 32-byte index key (the index_key) implicitly converts to a KeyContext. For an RBAC user, pass cyborg::KeyContext{user_kek, user_id} (write permission required). |
contents and json_metadata_array are required positional arguments. Pass an empty initializer {} when an item has no contents or metadata. When provided, their length must match ids.Exceptions
std::invalid_argument
std::invalid_argument
- Throws if vector dimensions are incompatible with the index configuration.
- Throws if index was not created or loaded yet.
- Throws if there is a mismatch between the number of
vectors,ids,contentsorjson_metadata_array.
std::runtime_error
std::runtime_error
- Throws if the vectors could not be upserted.
- Throws if the supplied key context lacks write permission.