Commit 928b806c authored by Alexandru Pandelea's avatar Alexandru Pandelea

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
parent 783d8169
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment