}
else { // need to exclude types or sources
BoolFilterBuilder typesNotSources = FilterBuilders.boolFilter();
BoolFilterBuilder tagsAndNothingElse = typesNotSources.must(FilterBuilders.termsFilter(DocumentPojo.tags_, invTagEl.getValue().toArray()));
if (null != score.sourceWeights) {
tagsAndNothingElse = tagsAndNothingElse.mustNot(FilterBuilders.termsFilter(DocumentPojo.sourceKey_, score.sourceWeights.keySet().toArray()));
}
if (null != score.typeWeights) {
tagsAndNothingElse = tagsAndNothingElse.mustNot(FilterBuilders.termsFilter(DocumentPojo.mediaType_, score.typeWeights.keySet().toArray()));
}
manualWeights.add(tagsAndNothingElse, invTagEl.getKey());