BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); //按照分类进行过滤查询 if (attrType != null && attrType.length > 0) { //过滤精准匹配,用作查询具体的分类 boolQueryBuilder.must(QueryBuilders.termsQuery("attr_type", attrType)); } //档案类型过滤 if (docType != null && docType.length > 0) { //过滤精准匹配,用作查询具体的分类 boolQueryBuilder.filter(QueryBuilders.termsQuery("doc_type", docType)); } boolQueryBuilder.must(QueryBuilders.existsQuery("title"));
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)