String[] tags, Pager... pager) {
if (tags == null || tags.length == 0 || StringUtils.isBlank(appid)) {
return new ArrayList<P>();
}
BoolFilterBuilder tagFilter = FilterBuilders.boolFilter();
//assuming clean & safe tags here
for (String tag : tags) {
tagFilter.must(FilterBuilders.termFilter(Config._TAGS, tag));
}
QueryBuilder qb = QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), tagFilter);
// The filter looks like this: ("tag1" OR "tag2" OR "tag3") AND "type"
return searchQuery(appid, type, qb, pager);
}