[gnome-documents] query: search into document author names as well



commit 67f6925fa60a88fca6d4da85dfee75728a676cfd
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Aug 30 19:48:27 2011 -0400

    query: search into document author names as well
    
    Extend the search string to the document author names, in addition to
    the title.

 src/query.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/query.js b/src/query.js
index 493e667..1c0ce5a 100644
--- a/src/query.js
+++ b/src/query.js
@@ -80,7 +80,11 @@ QueryBuilder.prototype = {
         let filter =
             ('fn:contains ' +
              '(fn:lower-case (tracker:coalesce(nie:title(?urn), nfo:fileName(?urn))), ' +
-             '"%s")').format(Global.filterController.getFilter());
+             '"%s") ||' +
+             'fn:contains ' +
+             '(fn:lower-case (tracker:coalesce(nco:fullname(?creator), nco:fullname(?publisher))), ' +
+             '"%s")').format(Global.filterController.getFilter(),
+                             Global.filterController.getFilter());
 
         return filter;
     },
@@ -164,6 +168,7 @@ QueryBuilder.prototype = {
         let sparql =
             'SELECT DISTINCT COUNT(?urn) WHERE { ' +
             this._buildTypeFilter() +
+            this._buildOptional() +
             this._buildFilterString() +
             '}';
 



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