title: ElasticSearch Java High Level REST Client: filter documents and or query
body: <p>I need to retrieve documments filtered by "brand" attribute, and retrieve those that have an specic value for another attribute. Example:</p>
  
  <p>All "apple" documents ("brand" attribute) that are active ("active" attribute true), with id "abc" , "def" or "ghi" values.</p>
  
  <p>I am using Java High Level REST Client.</p>
  
  <p>That is my code:</p>
  
  <pre><code>SearchRequest searchRequest = new SearchRequest(index);
    searchRequest.types(type);
  
    SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
  
    /* add query filters */
    MatchQueryBuilder matchQueryBuilder = new MatchQueryBuilder("brand", brand);
    searchSourceBuilder.query(matchQueryBuilder);
  
    /* base sort is added */
    //TODO: load sort from mapping based on baseSort of customSort
    searchSourceBuilder.sort(sortBy , SortOrder.DESC);
  
    /* add product id */
  
    BoolQueryBuilder boolQuery = QueryBuilders.boolQuery()
            .filter(QueryBuilders.termQuery("active", true));
  
    searchSourceBuilder.query(boolQuery);
    searchRequest.source(searchSourceBuilder);
  </code></pre>
  
  <p>Thank you!!</p>