eliminate duplicate results; order by data properly
This commit is contained in:
parent
fb9a75dee8
commit
24611f5cca
@ -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
|
||||
|
@ -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 ?;"
|
||||
;
|
||||
|
Loading…
x
Reference in New Issue
Block a user