...
|
...
|
@@ -6,6 +6,7 @@ import java.util.List; |
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.yoho.search.common.utils.SearchKeyWordUtils;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.elasticsearch.common.lucene.search.function.CombineFunction;
|
...
|
...
|
@@ -132,7 +133,7 @@ public class FunctionScoreSearchHelper { |
|
|
|
|
|
// 模糊搜索页的打分器
|
|
|
private List<IScorer> getFuzzyPageScorers(BoolQueryBuilder persionalFilter, Map<String, String> paramMap) {
|
|
|
List<IScorer> scorers = new ArrayList<IScorer>();
|
|
|
List<IScorer> scorers = new ArrayList<>();
|
|
|
// 1、不是默认搜索类页,返回空列表
|
|
|
if (!searchCommonHelper.isFuzzySearchPageDefault(paramMap)) {
|
|
|
return scorers;
|
...
|
...
|
@@ -141,11 +142,15 @@ public class FunctionScoreSearchHelper { |
|
|
scorers.addAll(this.getCommonScorers(persionalFilter, paramMap));
|
|
|
// 3、添加首次上架时间的打分器
|
|
|
scorers.add(searchScorerFactory.getFirstShelveTimeScorer(FUZZY_FIRST_SHELVE_SCORE));
|
|
|
//scorers.add(searchScorerFactory.getNewProductScorer(90));
|
|
|
// 4、添加频道搜索
|
|
|
scorers.add(searchScorerFactory.getChannelSearchScorer(paramMap));
|
|
|
// 5、添加线下可售商品打分器
|
|
|
scorers.add(searchScorerFactory.getOfflineSaleOnlyScorer());
|
|
|
// 6、添加关键词完全匹配的打分器
|
|
|
String query = MapUtils.getString(paramMap, SearchRequestParams.PARAM_SEARCH_QUERY);
|
|
|
if(StringUtils.isNotBlank(query)){
|
|
|
scorers.add(searchScorerFactory.getCsBrandKeyWordScorer(query));
|
|
|
}
|
|
|
return scorers;
|
|
|
}
|
|
|
|
...
|
...
|
|