redis / redis-om-python

Object mapping, and more, for Redis and Python
MIT License
1.06k stars 108 forks source link

Does Redis-om support fuzzy search #578

Closed saifullah-repliq closed 2 months ago

slorello89 commented 2 months ago

Yes, you fuzzy matching can be done by surrounding the word you are interested in with %, that will do a match up to a levenshtein distance of the number of % on either side of the search term:

Member.find(m.Member.bio % "%parey%") # levenshtein of 1
Member.find(m.Member.bio % "%%parey%%") # levenshtein of 2
Member.find(m.Member.bio % "%%%parey%%%") # levenshtein of 3

this will work up to a levenshtein of 3

See Fuzzy Searching in our docs for more details.