VSIM.SET
VSIM.SET index key value [value ...]
- Group
- Vector search
- Complexity
- O(log N) on average, N being the vectors in the index
- Arity
- -4 (at least 4 words, counting the command name)
- Flags
- write, slow
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
VSIM.SET stores a vector under the name key in the vector index index,
replacing the key’s previous vector if it had one. Give exactly as many
values as the index has dimensions.
key is just a name inside the index: it does not have to exist in the
keyspace, and deleting a keyspace key of the same name does not remove its
vector. Use the same name as the record it describes (for example the hash
holding a document) so search results point you to it. To filter searches by
tag, tag that keyspace key with TAG.SET.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| New key | Integer 1 |
Integer 1 |
| Existing key, vector replaced | Integer 0 |
Integer 0 |
Error replies:
ERR index 'name' not foundERR expected 3 dimensions, got 2(with the index’s and your counts).ERR invalid float at dimension 1for a value that is not a finite number (counting from 0).
Examples
Section titled “Examples”127.0.0.1:6379> VSIM.CREATEINDEX points 3 METRIC L2OK127.0.0.1:6379> VSIM.SET points p:1 1 0 0(integer) 1127.0.0.1:6379> VSIM.SET points p:1 1 0.5 0(integer) 0127.0.0.1:6379> VSIM.SET points p:2 1 1(error) ERR expected 3 dimensions, got 2127.0.0.1:6379> VSIM.SET points p:2 1 nan 0(error) ERR invalid float at dimension 1Compatibility
Section titled “Compatibility”HotKV-only command.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.