The server gets an array of query terms from a frontend ajax call:
req.query.filterTerms=['black', 'white', 'green']
I need to chain each ofthese filters to the bodybuilder query which is:
var body=bodybuilder()
.query('match', 'searchable', req.query.querytext)
.from(i)
.build();
How do i dynamically chain .filter() method/function for each of the query terms in the array to the bodybuilder instance?