Commit a2a72c18 by 田超

Merge branch 'feature/1003901-02' into 'master'

feat: [1003901] 系列书推荐

See merge request rays/pcloud-book!1057
parents a4eef801 59e9b90b
......@@ -3535,6 +3535,7 @@ public class BookBizImpl implements BookBiz {
if (hasKeyword){
isSeriesBook = true;
map.put("seriesBookId", seriesBook.getId());
break;
}
}
if (isSeriesBook){
......
......@@ -354,13 +354,12 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
.filter(null == agentId ? QueryBuilders.boolQuery() : QueryBuilders.termsQuery("adviserId", adviserIds))
.filter(null == subLabelId ? QueryBuilders.boolQuery() : QueryBuilders.termQuery("subLabelId", subLabelId))
.filter(ListUtils.isEmpty(templetIds) ? QueryBuilders.boolQuery() : QueryBuilders.termsQuery("templetId", templetIds));
BoolQueryBuilder should = QueryBuilders.boolQuery();
for (String keyword:keywords){
should.should(StringUtil.isEmpty(keyword) ? QueryBuilders.boolQuery() : QueryBuilders.wildcardQuery("bookName", "*" + keyword + "*"));
BoolQueryBuilder should = QueryBuilders.boolQuery().should(StringUtil.isEmpty(keyword) ? QueryBuilders.boolQuery() : QueryBuilders.wildcardQuery("bookName", "*" + keyword + "*"));
boolQueryBuilder.must(should);
}
BoolQueryBuilder should1 = QueryBuilders.boolQuery()
.should(QueryBuilders.termQuery("isAdviserBook",1));
boolQueryBuilder.must(should);
boolQueryBuilder.must(should1);
Sort sort = new Sort(Sort.Direction.DESC, "lastModifiedDate", "bookId");
PageRequest pageRequest = new PageRequest(currentPage, numPerPage, sort);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment