* mu-query: transfer queries to lowercase; this fixes some false-negatives

This commit is contained in:
Dirk-Jan C. Binnema
2010-09-05 21:21:26 +03:00
parent 283f3036a6
commit 51790dd888

View File

@ -181,13 +181,23 @@ mu_query_run (MuQuery *self, const char* searchexpr,
g_return_val_if_fail (searchexpr, NULL);
try {
char *lower_expr;
int err (0);
Xapian::Query q(get_query(self, searchexpr, &err));
/* translate the the searchexpr to all lowercase; this
* fill fixes some of the false-negatives. A full fix
* probably require some custom query parser.
*/
lower_expr = g_utf8_strdown (searchexpr, -1);
Xapian::Query q(get_query(self, lower_expr, &err));
if (err) {
g_warning ("Error in query '%s'", searchexpr);
g_warning ("Error in query '%s'", lower_expr);
g_free (lower_expr);
return NULL;
}
g_free (lower_expr);
Xapian::Enquire enq (*self->_db);