|
|
@@ -971,6 +971,10 @@ public class SearchServiceImpl implements SearchService {
|
|
|
(pageParams.getPage() - 1) * pageParams.getSize(), sort, true, false);
|
|
|
int totalHits = previousHits.totalHits;
|
|
|
if ((pageParams.getPage() - 1) * pageParams.getSize() >= totalHits) {
|
|
|
+ // 如果没有结果,则降低精度,直至 keyword 长度为 1
|
|
|
+ if(recursivelyGet && totalHits < 1 && !SearchUtils.isKeywordInvalid(keyword) && keyword.length() > 1){
|
|
|
+ return getGoodsIds(keyword.substring(0, keyword.length() - 1), keywordFields, tokenized, pageParams, recursivelyGet);
|
|
|
+ }
|
|
|
return map;
|
|
|
}
|
|
|
ScoreDoc[] previousScoreDocs = previousHits.scoreDocs;
|