I use redis hash to store my data. The key is a fixed value, the field stores "id" + "type" and the value stores the corresponding data. Is there anyway to query the data through a fuzzy key?
For example
The record is "ABC" : "12301" : "abc" and "ABC" : "12302" : "def", I want to use "ABC" + "123*"to query out the two records.
Thanks in advance!
1 Answer 1
Yes and no.
You can use HSCAN with glob-like patterns, which appears to be what you need.
That said, scanning big Hashes can be time-consuming. Instead, you can build your own indices (see for example Lexicographical Indexes or use a search engine such as RediSearch.