Leading "pz:id=" is optional in triggerSearch()
authorMike Taylor <mike@indexdata.com>
Fri, 6 Dec 2013 18:07:38 +0000 (18:07 +0000)
committerMike Taylor <mike@indexdata.com>
Fri, 6 Dec 2013 18:07:38 +0000 (18:07 +0000)
This means clever applications can pass in a complete filter string.

tools/htdocs/mkws.js

index 67bedc6..18ac664 100644 (file)
@@ -469,8 +469,10 @@ function triggerSearch (query, sort, targets)
        var filter = mkws.filters[i];
        if (filter.id) {
            if (pp2filter)
-               pp2filter += ",";
-           pp2filter += 'pz:id=' + filter.id;
+               pp2filter += "|";
+           if (filter.id.indexOf('pz:id=') != 0)
+               filter.id = 'pz:id=' + filter.id;
+           pp2filter += filter.id;
        } else {
            if (pp2limit)
                pp2limit += ",";