Showing
1 changed file
with
7 additions
and
5 deletions
@@ -259,11 +259,13 @@ public class SuggestServiceImpl implements ISuggestService, ApplicationEventPubl | @@ -259,11 +259,13 @@ public class SuggestServiceImpl implements ISuggestService, ApplicationEventPubl | ||
259 | if (StringUtils.isNotEmpty(dest)) { | 259 | if (StringUtils.isNotEmpty(dest)) { |
260 | int count = 0; | 260 | int count = 0; |
261 | for (String keyword : dest.split(",")) { | 261 | for (String keyword : dest.split(",")) { |
262 | - count++; | ||
263 | - resultTerms.add(keyword); | ||
264 | - // 最多返回五个推荐词 | ||
265 | - if (count == 5) { | ||
266 | - break; | 262 | + if(!queryWord.equalsIgnoreCase(keyword)) { |
263 | + count++; | ||
264 | + resultTerms.add(keyword); | ||
265 | + // 最多返回五个推荐词 | ||
266 | + if (count == 5) { | ||
267 | + break; | ||
268 | + } | ||
267 | } | 269 | } |
268 | } | 270 | } |
269 | } | 271 | } |
-
Please register or login to post a comment