From 58f3444ba1d7a67463f19f84659a67d07f6ce0a4 Mon Sep 17 00:00:00 2001 From: Alexander Butenko Date: Tue, 20 Jul 2010 15:25:34 -0400 Subject: [PATCH] Rework history panel search query --- panels/midori-history.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index 8e7d7cdd..84baaf60 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -207,16 +207,17 @@ midori_history_read_from_db (MidoriHistory* history, { gchar* filterstr; - sqlcmd = "SELECT uri, title, day FROM history_view " - "WHERE uri LIKE ? or title LIKE ? GROUP BY uri " + sqlcmd = "SELECT * FROM (" + " SELECT uri, title, day FROM history" + " WHERE uri LIKE ?1 OR title LIKE ?1 GROUP BY uri " "UNION ALL " - "SELECT replace(uri, '%s', title) AS uri, title, day " - "FROM search_view WHERE title LIKE ?1 GROUP BY uri " - "ORDER BY day ASC"; + " SELECT replace (uri, '%s', keywords) AS uri, " + " keywords AS title, day FROM search " + " WHERE uri LIKE ?1 OR keywords LIKE ?1 GROUP BY uri " + ") ORDER BY day ASC"; result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); filterstr = g_strdup_printf ("%%%s%%", filter); sqlite3_bind_text (statement, 1, filterstr, -1, g_free); - sqlite3_bind_text (statement, 2, g_strdup (filterstr), -1, g_free); req_day = -1; } else if (req_day == 0) -- 2.39.5