[nautilus] search-engine-tracker: don't use fts:match on empty search entry
- From: Alexandru-Ionut Pandelea <alexpandelea src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] search-engine-tracker: don't use fts:match on empty search entry
- Date: Tue, 16 May 2017 20:59:41 +0000 (UTC)
commit fd05b6f064a2a0beb60616ecb3fba898c3349a89
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date: Sat May 13 18:18:55 2017 +0300
search-engine-tracker: don't use fts:match on empty search entry
If the search entry is empty and filtering for date or mime type is
added, then the sparql query always returns nothing because of
fts:match '""*'
To get the expected search results don't use fts:match when the
search text is empty.
https://bugzilla.gnome.org/show_bug.cgi?id=782596
src/nautilus-search-engine-tracker.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-search-engine-tracker.c b/src/nautilus-search-engine-tracker.c
index 00d5a92..38126bb 100644
--- a/src/nautilus-search-engine-tracker.c
+++ b/src/nautilus-search-engine-tracker.c
@@ -328,9 +328,12 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider)
" nfo:fileLastModified ?mtime;"
" nfo:fileLastAccessed ?atime;"
" tracker:available true;"
- " nie:url ?url;");
+ " nie:url ?url");
- g_string_append_printf (sparql, " fts:match '\"%s\"*'", search_text);
+ if (*search_text)
+ {
+ g_string_append_printf (sparql, "; fts:match '\"%s\"*'", search_text);
+ }
if (mime_count > 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]