Search code examples
sqliteproximity

Sqlite Proximity Search


I have a text stored in my Sqlite table like:

stackoverflow

Is it possible to select this word with something like: SELECT * FROM record WHERE name (looks_close_to) 'stockoverflaw'?

I don't know how to put this clearly, proximity search I guess?

PS: I'm trying to give my user the correct word 'stackoverflow' when they typed 'stockoverflaw' insteed.


Solution

  • Thanks Shawn for the comment. The Spellfix1 extension is what I was looking for.

    This spellfix1 virtual table can be used to search a large vocabulary for close matches. For example, spellfix1 can be used to suggest corrections to misspelled words. Or, it could be used with FTS4 to do full-text search using potentially misspelled words.