diff options
author | Martyn Russell <martyn@lanedo.com> | 2010-04-09 14:23:02 +0100 |
---|---|---|
committer | Martyn Russell <martyn@lanedo.com> | 2010-04-13 11:13:58 +0100 |
commit | f5781b42cff4cf0159c618f77cb7a3c62636409e (patch) | |
tree | af7f90d263a753b3e0125c79993affa8cf445bcb /gtk/gtksearchenginetracker.c | |
parent | f6c1d54b3f68416fcc7dde1296f0975a3bc1dfd9 (diff) | |
download | gtk+-f5781b42cff4cf0159c618f77cb7a3c62636409e.tar.gz |
tracker-search-engine: Improve search query to order by rank and title
Diffstat (limited to 'gtk/gtksearchenginetracker.c')
-rw-r--r-- | gtk/gtksearchenginetracker.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtksearchenginetracker.c b/gtk/gtksearchenginetracker.c index 5fd988de22..18d821cc98 100644 --- a/gtk/gtksearchenginetracker.c +++ b/gtk/gtksearchenginetracker.c @@ -193,7 +193,7 @@ static void sparql_append_string_literal (GString *sparql, const gchar *str) { - char *s; + gchar *s; s = tracker_sparql_escape (str); @@ -303,15 +303,15 @@ gtk_search_engine_tracker_start (GtkSearchEngine *engine) if (tracker->priv->version == TRACKER_0_8 || tracker->priv->version == TRACKER_0_9) { - sparql = g_string_new ("SELECT ?url WHERE { ?file a nfo:FileDataObject; nie:url ?url; fts:match "); + sparql = g_string_new ("SELECT nie:url(?urn) WHERE { ?urn a nfo:FileDataObject; fts:match "); sparql_append_string_literal (sparql, search_text); if (location) { - g_string_append (sparql, " . FILTER (fn:starts-with(?url,"); + g_string_append (sparql, " . FILTER (fn:starts-with(nie:url(?urn),"); sparql_append_string_literal (sparql, location); g_string_append (sparql, "))"); } - g_string_append (sparql, " }"); + g_string_append (sparql, " } ORDER BY DESC(fts:rank(?urn)) ASC(nie:url(?urn))"); tracker_resources_sparql_query_async (tracker->priv->client, sparql->str, |