解决查询不出例外人

This commit is contained in:
xiaozhequ
2023-10-19 23:24:14 +08:00
parent acccac4d6e
commit 2cc74026bf

View File

@@ -371,7 +371,7 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
//查询出例外人员创建的课程
if(params.getSysCreateAids()!=null && params.getSysCreateAids().length>0) {
BoolQueryBuilder exception =QueryBuilders.boolQuery();
exception.must(QueryBuilders.termQuery("sysCreateAid",params.getSysCreateAids()));
exception.must(QueryBuilders.termsQuery("sysCreateAid",params.getSysCreateAids()));
audience.should(exception);
}
audience.should(has);
@@ -382,9 +382,9 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
//如果当前用户无受众,只能查询未设置受众的课程
boolQuery.should(QueryBuilders.termQuery("isSetAudience",0));
if(params.getSysCreateAids()!=null && params.getSysCreateAids().length>0) {
boolQuery.should(QueryBuilders.termQuery("sysCreateAid",params.getSysCreateAids()));
boolQuery.should(QueryBuilders.termsQuery("sysCreateAid",params.getSysCreateAids()));
}
boolQuery.minimumShouldMatch(1);
}
}