How to implement fuzzy search with SQLite's FTS3? How to implement fuzzy search with SQLite's FTS3? sqlite sqlite

How to implement fuzzy search with SQLite's FTS3?


SQLite's FTS allows searches only for entire words, or for word prefixes.

There is no built-in functionality for fuzzy searches like this.(And the Android database API does not allow you to add custom virtual table implementations.)


I went with relaxing my criteria to search all word beginnings:

private static String fixQuery(String query) {    return query.trim().replaceAll("\\s+", "*") + "*";}

it works pretty well. Not typo-resistant, but it feels natural when I'm using it.