[tracker] tracker-needle: Rewrite the "all" and "all in titles" query clauses



commit d6ed0b9a44fcdbfa48eb798b324d5d1c7da0cdd9
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Mar 22 15:56:52 2011 +0100

    tracker-needle: Rewrite the "all" and "all in titles" query clauses
    
    ?urn should be exposed as such to be consistent.

 src/tracker-needle/tracker-query.vala |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-needle/tracker-query.vala b/src/tracker-needle/tracker-query.vala
index 97a167b..399b492 100644
--- a/src/tracker-needle/tracker-query.vala
+++ b/src/tracker-needle/tracker-query.vala
@@ -36,10 +36,20 @@ public class Tracker.Query {
 
         private string [] where_clauses = {
         	// ALL
-                "WHERE { ?u fts:match \"%s\" . ?u nfo:belongsToContainer ?c ; tracker:available true . }",
+                "WHERE {
+                   ?urn fts:match \"%s\" ;
+                        nfo:belongsToContainer ?parent ;
+                        tracker:available true .
+                }",
 
 		// ALL_ONLY_IN_TITLES
-                "WHERE { ?u a nfo:FileDataObject ; nfo:belongsToContainer ?c ; tracker:available true . FILTER(fn:contains(fn:lower-case(nfo:fileName(?u)), \"$criteria_escaped_down\")) }",
+                "WHERE {
+                    ?urn a nfo:FileDataObject ;
+                         nfo:belongsToContainer ?parent ;
+                         tracker:available true .
+                         FILTER (fn:contains (fn:lower-case (nfo:fileName(?urn)), \"%s\"))
+                }",
+
 		// CONTACTS
                 "",
 



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