diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-02-02 15:21:28 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-02-02 20:52:32 +0100 |
commit | 245a7a445c4344d0b072fe7b988f66a7c7c7fce3 (patch) | |
tree | c25195e0fe14320c2f1d102cd7b293d1f1c9a074 | |
parent | ceb9600019930528ad134155c5f3a4faa2e9e90e (diff) | |
download | nautilus-245a7a445c4344d0b072fe7b988f66a7c7c7fce3.tar.gz |
search-engine-tracker: fix date bounds
With the previous patch we set the correct bound for the dates,
however due to https://bugzilla.gnome.org/show_bug.cgi?id=761455
bug in tracker, we cannot use dates vars defined in the SELECT clause
in the WHERE clause.
After discussing the nautilsu query to tracker, we came up that it's
not needed to use OPTIONAl and coalesce for it, since contentAccessed
is not something that will be set for files, instead the file ontology
should be used.
So just remove the coalesce and move the variables definitions to the
WHERE clause to make them with the correct type.
-rw-r--r-- | libnautilus-private/nautilus-search-engine-tracker.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libnautilus-private/nautilus-search-engine-tracker.c b/libnautilus-private/nautilus-search-engine-tracker.c index 6aeb19432..17cd5b8f6 100644 --- a/libnautilus-private/nautilus-search-engine-tracker.c +++ b/libnautilus-private/nautilus-search-engine-tracker.c @@ -298,16 +298,20 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider) mime_count = g_list_length (mimetypes); - sparql = g_string_new ("SELECT DISTINCT nie:url(?urn) fts:rank(?urn) tracker:coalesce(nfo:fileLastModified(?urn), nie:contentLastModified(?urn)) AS ?mtime tracker:coalesce(nfo:fileLastAccessed(?urn), nie:contentAccessed(?urn)) AS ?atime \n" + sparql = g_string_new ("SELECT DISTINCT nie:url(?urn) fts:rank(?urn) nfo:fileLastModified(?urn) nfo:fileLastAccessed(?urn)\n" "WHERE {" - " ?urn a nfo:FileDataObject ;" - " tracker:available true ; "); + " ?urn a nfo:FileDataObject;" + " nfo:fileLastModified ?mtime;" + " nfo:fileLastAccessed ?atime;" + " tracker:available true;"); + + g_string_append_printf (sparql, " fts:match '\"%s*\"'", search_text); if (mime_count > 0) { - g_string_append (sparql, "nie:mimeType ?mime ;"); + g_string_append (sparql, "; nie:mimeType ?mime"); } - g_string_append_printf (sparql, " fts:match '\"%s*\"' . FILTER ( ", search_text); + g_string_append_printf (sparql, " . FILTER( "); if (!tracker->details->recursive) { g_string_append_printf (sparql, "tracker:uri-is-parent('%s', nie:url(?urn)) && ", location_uri); |