From 670e213e6446972b9debf8d86663b9cba502e627 Mon Sep 17 00:00:00 2001 From: hequan_waynaqua <1669738430@qq.com> Date: Sun, 1 Nov 2020 17:12:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=89=8B=E6=9C=BA=E7=AB=AF):=20=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化搜索操作 --- .../main/java/com/wayn/common/core/domain/vo/SearchVO.java | 6 +++++- .../com/wayn/mobile/api/controller/SearchController.java | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/waynboot-common/src/main/java/com/wayn/common/core/domain/vo/SearchVO.java b/waynboot-common/src/main/java/com/wayn/common/core/domain/vo/SearchVO.java index ba8655d..e82fb8b 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/domain/vo/SearchVO.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/domain/vo/SearchVO.java @@ -15,9 +15,13 @@ public class SearchVO { private Integer brandId; private Boolean isNew; - + private Boolean isHot; + private Boolean filterNew; + + private Boolean filterHot; + private Boolean isSales; private Boolean isPrice; diff --git a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/SearchController.java b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/SearchController.java index 58f5c8b..a7a11bb 100644 --- a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/SearchController.java +++ b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/SearchController.java @@ -93,7 +93,9 @@ public class SearchController extends BaseController { } // 按热门商品 if (isHot) { - searchSourceBuilder.sort(new FieldSortBuilder("isHot").order(SortOrder.DESC)); + // searchSourceBuilder.sort(new FieldSortBuilder("isHot").order(SortOrder.DESC)); + MatchQueryBuilder filterQuery1 = QueryBuilders.matchQuery("isHot", true); + searchSourceBuilder.postFilter(filterQuery1); } // 按新品 if (isNew) {