diff --git a/documentation/TODO.md b/documentation/TODO.md index 6d36b20..5613d96 100644 --- a/documentation/TODO.md +++ b/documentation/TODO.md @@ -1,4 +1,3 @@ -+ make case insensitive search optional -+ make fuzzy searching optional + make (potentially slow) queries cancel using multi threading -+ the same suggestion should only show up once ++ levenstein seems horribly buggy with single character results ++ rebinding queries should be faster than repreparing them diff --git a/source/storage.cpp b/source/storage.cpp index 2600c6a..c997cf5 100644 --- a/source/storage.cpp +++ b/source/storage.cpp @@ -15,24 +15,32 @@ bool is_caseless = false; const char * const literal_query = "SELECT * FROM entries " "WHERE data GLOB CONCAT('*', ?, '*') " + "GROUP BY data " + "ORDER BY stamp DESC " "LIMIT ? " "OFFSET ?;" ; const char * const literal_caseless_query = "SELECT * FROM entries " "WHERE data LIKE CONCAT('%', ?, '%') " + "GROUP BY data " + "ORDER BY stamp DESC " "LIMIT ? " "OFFSET ?;" ; const char * const levenstein_query = "SELECT * FROM entries " - "ORDER BY DAMERAU_LEVENSHTEIN_SUBSTRING(data, ?) " + "GROUP BY data " + "ORDER BY DAMERAU_LEVENSHTEIN_SUBSTRING(data, ?), " + "stamp DESC " "LIMIT ? " "OFFSET ?;" ; const char * const levenstein_caseless_query = "SELECT * FROM entries " - "ORDER BY DAMERAU_LEVENSHTEIN_SUBSTRING(LOWER(data), LOWER(?)) " + "GROUP BY data " + "ORDER BY DAMERAU_LEVENSHTEIN_SUBSTRING(LOWER(data), LOWER(?)), " + "stamp DESC " "LIMIT ? " "OFFSET ?;" ;