query = query.must(boolQuery().must(termQuery(TAGS, tag)));
}
if (rank != null) {
query = query.must(boolQuery().must(termQuery("rank", rank)));
}
<BUG>BoolFilterBuilder filter = FilterBuilders.boolFilter();</BUG>
if (!Strings.isNullOrEmpty(country)) {
<BUG>filter = filter.must(termFilter("country", country));
</BUG>
}

query = query.must(boolQuery().must(termQuery(TAGS, tag)));
}
if (rank != null) {
query = query.must(boolQuery().must(termQuery("rank", rank)));
}
if (!Strings.isNullOrEmpty(country)) {
query = query.must(termQuery("country", country));
}
