Type | Command | Syntax | Description |
Operations on vector indexes | TVS.CREATEINDEX | TVS.CREATEINDEX index_name dims algorithm distance_method [algo_param_key alog_param_value] ...
| Creates a vector index based on the specified distance formula and algorithm. The algorithm is used to create the index and perform queries. The index can be deleted only by running the TVS.DELINDEX command. |
TVS.GETINDEX | TVS.GETINDEX index_name
| Queries the specified vector index and retrieves the metadata of the index. |
TVS.DELINDEX | TVS.DELINDEX index_name
| Deletes the specified vector index and all data of the index. |
TVS.SCANINDEX | TVS.SCANINDEX cursor [MATCH pattern] [COUNT count]
| Scans the vector indexes that meet specific criteria in the Tair instance. |
Operations on vectors | TVS.HSET | TVS.HSET index_name key attribute_key attribute_value [attribute_key attribute_value] ...
| Inserts a vector into the specified vector index. If the vector already exists, the existing data is overwritten. |
TVS.HGETALL | TVS.HGETALL index_name key
| Queries all data records of the specified key in the specified vector index. |
TVS.HMGET | TVS.HMGET index_name key attribute_key [attribute_key ...]
| Queries the values of attribute keys in the specified key of the specified vector index. |
TVS.DEL | TVS.DEL index_name key [key ...]
| Deletes the specified vectors from the specified vector index by using the key parameter. |
TVS.HDEL | TVS.HDEL index_name key attribute_key [attribute_key ...]
| Deletes the specified attributes of the specified vector from the specified vector index. |
TVS.SCAN | TVS.SCAN index_name cursor [MATCH pattern] [COUNT count] [FILTER filter_string] [VECTOR vector] [MAX_DIST max_distance]
| Scans the keys that meet specific criteria in the specified vector index. |
TVS.HINCRBY | TVS.HINCRBY index_name key attribute_key num
| Increases the value of the specified attribute key for the specified key in the specified vector index by a given integer value (num). |
TVS.HINCRBYFLOAT | TVS.HINCRBYFLOAT index_name key attribute_key num
| Increases the value of the specified attribute key for the specified key in the specified vector index by a given floating-point number (num). |
TVS.HPEXPIREAT | TVS.HPEXPIREAT index_name key milliseconds-timestamp
| Specifies an absolute expiration time that is accurate to the millisecond for the specified key in the specified vector index. |
TVS.HPEXPIRE | TVS.HPEXPIRE index_name key milliseconds-timestamp
| Specifies a relative expiration time that is accurate to the millisecond for the specified key in the specified vector index. |
TVS.HEXPIREAT | TVS.HEXPIREAT index_name key timestamp
| Specifies an absolute expiration time that is accurate to the second for the specified key in the specified vector index. |
TVS.HEXPIRE | TVS.HEXPIRE index_name key timestamp
| Specifies a relative expiration time that is accurate to the second for the specified key in the specified vector index. |
TVS.HPTTL | TVS.HPTTL index_name key
| Queries the TTL of the specified key in the specified vector index, accurate to the millisecond. |
TVS.HTTL | TVS.HTTL index_name key
| Queries the TTL of the specified key in the specified vector index, accurate to the second. |
TVS.HPEXPIRETIME | TVS.HPEXPIRETIME index_name key
| Queries the absolute expiration time of the specified key in the specified vector index, accurate to the millisecond. |
TVS.HEXPIRETIME | TVS.HEXPIRETIME index_name key
| Queries the absolute expiration time of the specified key in the specified vector index, accurate to the second. |
Vector nearest-neighbor query | TVS.KNNSEARCH | TVS.KNNSEARCH index_name topN vector [filter_string] [param_key param_value]
| Queries the nearest-neighbor vectors of the specified vector in the specified vector index. Up to 10,000 vectors can be returned. |
TVS.KNNSEARCHFIELD | TVS.KNNSEARCHFIELD index_name topN vector field_count field_name [field_name ...] [filter_string] [param_key param_value]
| Queries the nearest-neighbor vectors of the specified vector in the specified vector index. The search logic of this command is the same as that of TVS.KNNSEARCH, with the additional capability to return tag attributes along with the search results. |
TVS.GETDISTANCE | TVS.GETDISTANCE index_name vector key_count key [key, ...] [TOPN topN] [FILTER filter_string] [MAX_DIST max_distance]
| Performs vector nearest-neighbor queries for the specified keys in the specified vector index. |
TVS.MKNNSEARCH | TVS.MKNNSEARCH index_name topN vector_count vector [vector ...] [filter_string] [param_key param_value]
| Queries the nearest-neighbor vectors of the specified vectors in the specified vector index. |
TVS.MINDEXKNNSEARCH | TVS.MINDEXKNNSEARCH index_count index_name [index_name ...] topN vector [filter_string] [param_key param_value]
| Queries the nearest-neighbor vectors of the specified vector across multiple vector indexes. |
TVS.MINDEXKNNSEARCHFIELD | TVS.MINDEXKNNSEARCHFIELD index_count index_name [index_name ...] topN vector field_count field_name [field_name ...] [filter_string] [param_key param_value]
| Queries the nearest-neighbor vectors of the specified vector across multiple vector indexes. Tag attributes can be returned along with the search results. |
TVS.MINDEXMKNNSEARCH | TVS.MINDEXMKNNSEARCH index_count index_name [index_name ...] topN vector_count vector [vector ...] [filter_string] [param_key param_value]
| Queries the nearest-neighbor vectors of the specified vectors across multiple vector indexes. |