[gtk+/tracker-0.8: 2/3] tracker-search-engine: Improve search query to order by rank and title
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/tracker-0.8: 2/3] tracker-search-engine: Improve search query to order by rank and title
- Date: Fri, 9 Apr 2010 13:34:16 +0000 (UTC)
commit 753b1fd79f02c324c1812edbd5547d46cf32c7a8
Author: Martyn Russell <martyn lanedo com>
Date: Fri Apr 9 14:23:02 2010 +0100
tracker-search-engine: Improve search query to order by rank and title
gtk/gtksearchenginetracker.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtksearchenginetracker.c b/gtk/gtksearchenginetracker.c
index 5fd988d..18d821c 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]