September 2017
Beginner to intermediate
396 pages
9h 46m
English
In this recipe, we used a Redis sorted set for storing the search data. A sorted set stores the data sorted with a score. Each score should be attached with only a single value. Here, we get the name of the stock, such as EcoWise Holdings Ltd, or Eastern Holdings Ltd. We convert them into prefixes, as discussed earlier. Since both the names contain the word "Holdings", we will have a sorted set with a holdi key (remember that we convert all names to lowercase), and two values:
holdi - score = 0.0, value = 5CT
holdi - score = 0.0, value = BDT
When we search for the string hold, both the values should be returned. From the values, we find the name from the hash set, and return the set of names. We can further optimize the search ...
Read now
Unlock full access