Commit 84cdfd16 by 郑永强

bug: [none] ES搜索-没输入关键时,立项排前面

parent a802d072
......@@ -317,6 +317,9 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
}
// 排序:因为涉及分词,故而_score固定放在第一位
Sort sort = new Sort(Sort.Direction.DESC, "_score", "isApproval", "isFundSupport", "fundBookValue", "resourceCount", "isAdviserBook", "lastModifiedDate", "bookId");
if(StringUtil.isEmpty(keyword)){
sort = new Sort(Sort.Direction.DESC, "isApproval", "_score", "isFundSupport", "fundBookValue", "resourceCount", "isAdviserBook", "lastModifiedDate", "bookId");
}
PageRequest pageRequest = new PageRequest(currentPage, numPerPage, sort);
Page<ESBookAndAdviser> search = bookAndAdviserRepository.search(boolQueryBuilder, pageRequest);
......
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