...
|
...
|
@@ -542,7 +542,13 @@ public class SuggestServiceImpl implements ISuggestService, ApplicationEventPubl |
|
|
|
|
|
// 1) 构建ES请求
|
|
|
SearchParam searchParam = new SearchParam();
|
|
|
QueryBuilder queryBuilder = StringUtils.isNotEmpty(queryWord) ? QueryBuilders.matchQuery("keyword.keyword_ik", queryWord) : QueryBuilders.matchAllQuery();
|
|
|
QueryBuilder queryBuilder = QueryBuilders.matchAllQuery();
|
|
|
if (StringUtils.isNotEmpty(queryWord)) {
|
|
|
// 是否精确匹配
|
|
|
String accurateQuery = paramMap.get("accurate");
|
|
|
queryBuilder = "Y".equalsIgnoreCase(accurateQuery) ? QueryBuilders.matchQuery("standardKeyword", CharUtils.standardized(queryWord)) : QueryBuilders.matchQuery("keyword.keyword_ik", queryWord);
|
|
|
}
|
|
|
|
|
|
searchParam.setQuery(queryBuilder);
|
|
|
searchParam.setPage(page);
|
|
|
searchParam.setOffset((page - 1) * 10);
|
...
|
...
|
|