Package org.elasticsearch.index.query

Examples of org.elasticsearch.index.query.BoolFilterBuilder.mustNot()


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


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

TOP
Copyright © 2018 www.massapi.com. 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.