[#66,filters,elasticsearch][s]: elasticsearch support for filters (addTermFilter on Query).

This commit is contained in:
Rufus Pollock
2012-04-02 21:05:56 +01:00
parent 36548ceffc
commit 5a73ced225
2 changed files with 19 additions and 0 deletions

View File

@@ -79,6 +79,19 @@ this.recline.Backend = this.recline.Backend || {};
}
delete out.q;
}
// now do filters (note the *plural*)
if (out.filters && out.filters.length) {
if (!out.filter) {
out.filter = {}
}
if (!out.filter.and) {
out.filter.and = [];
}
out.filter.and = out.filter.and.concat(out.filters);
}
if (out.filters != undefined) {
delete out.filters;
}
return out;
},
query: function(model, queryObj) {