Authored by 胡古飞

query trim

@@ -44,7 +44,7 @@ public class FunctionScoreSearchHelper { @@ -44,7 +44,7 @@ public class FunctionScoreSearchHelper {
44 functionScoreQueryBuilder.add(QueryBuilders.termQuery("isGlobal", "Y"), genWeightFactorBuilder(globalWeight)); 44 functionScoreQueryBuilder.add(QueryBuilders.termQuery("isGlobal", "Y"), genWeightFactorBuilder(globalWeight));
45 } 45 }
46 if (searchCommonHelper.isFuzzySearchDefault(paramMap)) { 46 if (searchCommonHelper.isFuzzySearchDefault(paramMap)) {
47 - String queryLowerCase = paramMap.get("query").toLowerCase(); 47 + String queryLowerCase = paramMap.get("query").trim().toLowerCase();
48 functionScoreQueryBuilder.add(QueryBuilders.termQuery("brandName.brandName_lowercase", queryLowerCase), this.genWeightFactorBuilder(brandTotalMatchWeight)); 48 functionScoreQueryBuilder.add(QueryBuilders.termQuery("brandName.brandName_lowercase", queryLowerCase), this.genWeightFactorBuilder(brandTotalMatchWeight));
49 } 49 }
50 if (searchCommonHelper.isNeedDeScoreBrandSearch(paramMap)) { 50 if (searchCommonHelper.isNeedDeScoreBrandSearch(paramMap)) {