Package org.elasticsearch.index.query

Examples of org.elasticsearch.index.query.BoolFilterBuilder


      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);
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.query.BoolFilterBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.