Authored by 胡古飞

fix SearchServiceHelper

... ... @@ -23,10 +23,7 @@ import com.yoho.search.base.utils.ConvertUtils;
import com.yoho.search.base.utils.DateUtil;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.base.utils.ProductIndexEsField;
import com.yoho.search.service.service.SearchCommonService;
import com.yoho.search.service.service.SearchDynamicConfigService;
import com.yoho.search.service.service.SearchKeyWordService;
import com.yoho.search.service.service.base.ProductIndexBaseService;
import com.yoho.search.service.utils.SearchKeyWordUtils;
import com.yoho.search.service.utils.SearchRequestParams;
... ... @@ -40,13 +37,7 @@ public class SearchServiceHelper {
@Autowired
private SearchKeyWordService searchKeyWordService;
@Autowired
private SearchDynamicConfigService dynamicConfig;
@Autowired
private SearchCommonService searchCommonService;
@Autowired
private FunctionScoreSearchHelper functionScoreSearchHelper;
@Autowired
private ProductIndexBaseService productIndexBaseService;
/**
* 构造关键字查询的query
... ... @@ -81,7 +72,7 @@ public class SearchServiceHelper {
// 4.设置查询字段和比重【AND表示多字段都要匹配,可提高精确度】
this.setDefaultSearchField(queryBuilder, paramMap);
if (ISearchConstants.SEARCH_OPERATOR.equalsIgnoreCase("or")) {
if ("or".equalsIgnoreCase(ISearchConstants.SEARCH_OPERATOR)) {
queryBuilder.operator(MatchQueryBuilder.Operator.OR);
queryBuilder.minimumShouldMatch(ISearchConstants.SEARCH_MINIMUM_SHOULD_MATCH);
} else {
... ... @@ -507,7 +498,7 @@ public class SearchServiceHelper {
// 如果showPhrase=Y,则加上isPhrasein(Y/N),做缓存用
if ("Y".equals(paramMap.get(SearchRequestParams.SHOW_PHRASE))) {
boolFilter.must(QueryBuilders.termsQuery(ProductIndexEsField.isPhraseExist, Arrays.asList("Y","N")));
boolFilter.must(QueryBuilders.termsQuery(ProductIndexEsField.isPhraseExist, Arrays.asList("Y", "N")));
}
// 通用的过滤请求
... ...