From the course: Advanced Redis

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Performing fuzzy search

Performing fuzzy search - Redis Tutorial

From the course: Advanced Redis

Performing fuzzy search

Redis also supports fuzzy searches or approximate searches. Let me show you how fuzzy search works. I'm going to search for the term "sports" in the name index, that is, in the name of all of the documents that I have indexed. There are three documents that match my query and contain the term "sports" in the name. Let's say while typing out the term "sports," I misspelled it by mistake. I am searching for "spots" when I actually meant "sports." Now this is not a fuzzy search. The term "spots" is not present in the name of any document and I get zero results for my query. In order to account for spelling mistakes, I might want to perform a fuzzy search or approximate search. Now I search for "spots," but because I've specified the percentage signs, this search will be a fuzzy search and this will match the term "sports" that is close to "spots." Note that in the query I've enclosed the word "spots" in a single pair of percentage signs. This returns matches for words which are at a…

Contents