[nautilus/wip/csoriano/search-popover: 10/40] search-engine-tracker: fix date bounds
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/csoriano/search-popover: 10/40] search-engine-tracker: fix date bounds
- Date: Tue, 2 Feb 2016 17:41:49 +0000 (UTC)
commit 615b6130f9a1da188c70a2fed876e6f6b6327969
Author: Carlos Soriano <csoriano gnome org>
Date: Tue Feb 2 15:21:28 2016 +0100
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.
For that, we need to move them to the WHERE clause and still make them
OPTIONAL.
.../nautilus-search-engine-tracker.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/libnautilus-private/nautilus-search-engine-tracker.c
b/libnautilus-private/nautilus-search-engine-tracker.c
index 6aeb194..cb16727 100644
--- a/libnautilus-private/nautilus-search-engine-tracker.c
+++ b/libnautilus-private/nautilus-search-engine-tracker.c
@@ -298,16 +298,23 @@ 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)
tracker:coalesce(nfo:fileLastModified(?urn), nie:contentLastModified(?urn))
tracker:coalesce(nfo:fileLastAccessed(?urn), nie:contentAccessed(?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,
+ " . OPTIONAL {?urn nie:contentLastModified ?mtime}"
+ " . OPTIONAL {?urn nie:contentAccessed ?atime}");
+ 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]