[nautilus] search-engine-tracker: check in query if files have nie:url



commit 928b806cb559e9509c0d81d45bd118243fa33ab0
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date:   Wed Jan 4 17:56:01 2017 +0200

    search-engine-tracker: check in query if files have nie:url
    
    For tracker:uri-is-parent if nie:url is null, then tracker would
    give an error.
    
    To fix this, before the FILTER, make sure that the file has nie:url.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776869

 src/nautilus-search-engine-tracker.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-search-engine-tracker.c b/src/nautilus-search-engine-tracker.c
index 95a1dae..00d5a92 100644
--- a/src/nautilus-search-engine-tracker.c
+++ b/src/nautilus-search-engine-tracker.c
@@ -327,7 +327,8 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider)
                            "  ?urn a nfo:FileDataObject;"
                            "  nfo:fileLastModified ?mtime;"
                            "  nfo:fileLastAccessed ?atime;"
-                           "  tracker:available true;");
+                           "  tracker:available true;"
+                           "  nie:url ?url;");
 
     g_string_append_printf (sparql, " fts:match '\"%s\"*'", search_text);
 
@@ -340,11 +341,11 @@ nautilus_search_engine_tracker_start (NautilusSearchProvider *provider)
 
     if (!tracker->details->recursive)
     {
-        g_string_append_printf (sparql, "tracker:uri-is-parent('%s', nie:url(?urn)) && ", location_uri);
+        g_string_append_printf (sparql, "tracker:uri-is-parent('%s', ?url) && ", location_uri);
     }
     else
     {
-        g_string_append_printf (sparql, "tracker:uri-is-descendant('%s', nie:url(?urn)) && ", location_uri);
+        g_string_append_printf (sparql, "tracker:uri-is-descendant('%s', ?url) && ", location_uri);
     }
 
     g_string_append_printf (sparql, "fn:contains(fn:lower-case(nfo:fileName(?urn)), '%s')", search_text);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]