yezhizi opened a new pull request, #3164:
URL: https://github.com/apache/kvrocks/pull/3164
Add a new CF for label-based indexing. The key format is as following:
```
+-----------+--------------+----------------+------------+------------------+--------------+---------+
| ns | index_type | label_key_size | label_key | label_value_size
| label_value | key | => null
| (1+Xbytes)| (1byte) | (4byte) | (Ybyte) | (4byte)
| (Zbyte) | (Kbyte) |
+-----------+--------------+----------------+------------+------------------+--------------+---------+
```
| enum | index_type |
| ---- | ---------- |
| 0 | `TS_LABEL` |
Now we can do:
```
127.0.0.1:6666> TS.CREATE temp:TLV LABELS type temp location TLV
127.0.0.1:6666> TS.CREATE temp:JLM LABELS type temp location JLM
127.0.0.1:6666> TS.MADD temp:TLV 1000 30 temp:TLV 1010 35 temp:TLV 1020 9999
temp:TLV 1030 40
127.0.0.1:6666> TS.MADD temp:JLM 1005 30 temp:JLM 1015 35 temp:JLM 1025 9999
temp:JLM 1035 40
127.0.0.1:6666> TS.MGET WITHLABELS FILTER type=temp
1) 1) "temp:JLM"
2) 1) 1) "location"
2) "JLM"
2) 1) "type"
2) "temp"
3) 1) 1) (integer) 1035
2) (double) 40
2) 1) "temp:TLV"
2) 1) 1) "location"
2) "TLV"
2) 1) "type"
2) "temp"
3) 1) 1) (integer) 1030
2) (double) 40
127.0.0.1:6666> TS.MGET SELECTED_LABELS location FILTER type=temp
1) 1) "temp:JLM"
2) 1) 1) "location"
2) "JLM"
3) 1) 1) (integer) 1035
2) (double) 40
2) 1) "temp:TLV"
2) 1) 1) "location"
2) "TLV"
3) 1) 1) (integer) 1030
2) (double) 40
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]