Class ESQueryUtils


  • public class ESQueryUtils
    extends Object
    • Constructor Detail

      • ESQueryUtils

        public ESQueryUtils()
    • Method Detail

      • mapToBoolQueryBuilder

        public static org.elasticsearch.index.query.BoolQueryBuilder mapToBoolQueryBuilder​(org.elasticsearch.index.query.QueryBuilder query)
      • mergeQueries

        public static org.elasticsearch.index.query.QueryBuilder mergeQueries​(org.elasticsearch.index.query.QueryBuilder q1,
                                                                              org.elasticsearch.index.query.QueryBuilder q2)
        Make sure both queries are combined as a boolean query with must-clauses. If one of them already is a boolean query with must clauses, the other one will be appended to it.
        Parameters:
        q1 - first query
        q2 - second query
        Returns:
        q1 or q2 if one of them is null, otherwise a BoolQueryBuilder