Our great sponsors
-
SymSpell
SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
If you want to do both at the same time (prefix search, allowing for misspellings), you can use a trie, but rather than just putting all your words in it, you can put everything in the "deletion neighborhood" of each word (that is, each possible variant of each word that has one character deleted), in an approach sort of like what's described here. Fair warning, though, that this gets a little hairy, and you'll have to decide how to weight prefix matches vs. misspellings in your rankings.