Skip to content

Commit

Permalink
Update EsProductServiceImpl.java
Browse files Browse the repository at this point in the history
  • Loading branch information
macrozheng committed Jul 14, 2022
1 parent 82faecd commit 818fe14
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;


Expand Down Expand Up @@ -121,7 +123,7 @@ public Page<EsProduct> search(String keyword, Long brandId, Long productCategory
nativeSearchQueryBuilder.withFilter(boolQueryBuilder);
}
//搜索
if (StringUtils.isEmpty(keyword)) {
if (StrUtil.isEmpty(keyword)) {
nativeSearchQueryBuilder.withQuery(QueryBuilders.matchAllQuery());
} else {
List<FunctionScoreQueryBuilder.FilterFunctionBuilder> filterFunctionBuilders = new ArrayList<>();
Expand Down

0 comments on commit 818fe14

Please sign in to comment.