"pz:id=" prefix only prepended to filter string if it doesn't have ANY
authorMike Taylor <mike@indexdata.com>
Mon, 9 Dec 2013 22:00:55 +0000 (22:00 +0000)
committerMike Taylor <mike@indexdata.com>
Mon, 9 Dec 2013 22:00:55 +0000 (22:00 +0000)
setting+op up front. Allows more flexibility in the use of ~ operation
and non-pz:id settings.

tools/htdocs/mkws.js

index 18ac664..ec346d2 100644 (file)
@@ -469,9 +469,12 @@ function triggerSearch (query, sort, targets)
        var filter = mkws.filters[i];
        if (filter.id) {
            if (pp2filter)
-               pp2filter += "|";
-           if (filter.id.indexOf('pz:id=') != 0)
+               pp2filter += ",";
+           if (filter.id.match(/^[a-z:]+[=~]/)) {
+               log("filter '" + filter + "' already begins with SETTING OP");
+           } else {
                filter.id = 'pz:id=' + filter.id;
+           }
            pp2filter += filter.id;
        } else {
            if (pp2limit)