Authored by Gino Zhang

Merge branch 'master' into zf_suggest

@@ -25,8 +25,8 @@ public class FunctionScoreSearchHelper { @@ -25,8 +25,8 @@ public class FunctionScoreSearchHelper {
25 private SearchDynamicConfigService dynamicConfig; 25 private SearchDynamicConfigService dynamicConfig;
26 26
27 private static float globalWeight = 0.50f; 27 private static float globalWeight = 0.50f;
28 - private static float brandTotalMatchWeight = 5f;  
29 - 28 + //private static float brandTotalMatchWeight = 5f;
  29 +
30 private WeightBuilder genWeightFactorBuilder(float factor) { 30 private WeightBuilder genWeightFactorBuilder(float factor) {
31 return ScoreFunctionBuilders.weightFactorFunction(factor); 31 return ScoreFunctionBuilders.weightFactorFunction(factor);
32 } 32 }
@@ -43,10 +43,10 @@ public class FunctionScoreSearchHelper { @@ -43,10 +43,10 @@ public class FunctionScoreSearchHelper {
43 if (searchCommonHelper.containGlobal(paramMap)) { 43 if (searchCommonHelper.containGlobal(paramMap)) {
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)) {  
47 - String queryLowerCase = paramMap.get("query").trim().toLowerCase();  
48 - functionScoreQueryBuilder.add(QueryBuilders.termQuery("brandName.brandName_lowercase", queryLowerCase), this.genWeightFactorBuilder(brandTotalMatchWeight));  
49 - } 46 +// if (searchCommonHelper.isFuzzySearchDefault(paramMap)) {
  47 +// String queryLowerCase = paramMap.get("query").trim().toLowerCase();
  48 +// functionScoreQueryBuilder.add(QueryBuilders.termQuery("brandName.brandName_lowercase", queryLowerCase), this.genWeightFactorBuilder(brandTotalMatchWeight));
  49 +// }
50 if (searchCommonHelper.isNeedDeScoreBrandSearch(paramMap)) { 50 if (searchCommonHelper.isNeedDeScoreBrandSearch(paramMap)) {
51 functionScoreQueryBuilder.add(QueryBuilders.termQuery("isForbiddenSortBrand", "1"), ScoreFunctionBuilders.weightFactorFunction(0)); 51 functionScoreQueryBuilder.add(QueryBuilders.termQuery("isForbiddenSortBrand", "1"), ScoreFunctionBuilders.weightFactorFunction(0));
52 } 52 }
@@ -30,7 +30,7 @@ search.index.translog.flush_threshold_ops=5000 @@ -30,7 +30,7 @@ search.index.translog.flush_threshold_ops=5000
30 #search 30 #search
31 search.minimum.should.match=75% 31 search.minimum.should.match=75%
32 search.operator=and 32 search.operator=and
33 -search.default.field=smallSort^1000,smallSort.smallSort_pinyin^1000,middleSort^950,middleSort.middleSort_pinyin^950,maxSort^900,maxSort.maxSort_pinyin^900,brandName^900,brandNameCn^850,brandNameCn.brandNameCn_pinyin^850,brandNameEn^800,brandDomain^800,specialSearchField^700,productName.productName_ansj^300,standardOnlyNames.standardOnlyNames_pinyin^250,standardOnlyNames.standardOnlyNames_ansj^250,productKeyword^50,brandKeyword^30,genderS^20,searchField_ansj^10,searchField,productSkn.productSkn_ansj 33 +search.default.field=brandName.brandName_lowercase^2000,smallSort^1000,smallSort.smallSort_pinyin^1000,middleSort^950,middleSort.middleSort_pinyin^950,maxSort^900,maxSort.maxSort_pinyin^900,brandName^900,brandNameCn^850,brandNameCn.brandNameCn_pinyin^850,brandNameEn^800,brandDomain^800,specialSearchField^700,productName.productName_ansj^300,standardOnlyNames.standardOnlyNames_pinyin^250,standardOnlyNames.standardOnlyNames_ansj^250,productKeyword^50,brandKeyword^30,genderS^20,searchField_ansj^10,searchField,productSkn.productSkn_ansj
34 search.script.score=_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8) 34 search.script.score=_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8)
35 search.script.lang=groovy 35 search.script.lang=groovy
36 36
@@ -30,7 +30,7 @@ search.index.translog.flush_threshold_ops=${search.index.translog.flush_threshol @@ -30,7 +30,7 @@ search.index.translog.flush_threshold_ops=${search.index.translog.flush_threshol
30 #search 30 #search
31 search.minimum.should.match=75% 31 search.minimum.should.match=75%
32 search.operator=and 32 search.operator=and
33 -search.default.field=smallSort^1000,smallSort.smallSort_pinyin^1000,middleSort^950,middleSort.middleSort_pinyin^950,maxSort^900,maxSort.maxSort_pinyin^900,brandName^900,brandNameCn^850,brandNameCn.brandNameCn_pinyin^850,brandNameEn^800,brandDomain^800,specialSearchField^700,productName.productName_ansj^300,standardOnlyNames.standardOnlyNames_pinyin^250,standardOnlyNames.standardOnlyNames_ansj^250,productKeyword^50,brandKeyword^30,genderS^20,searchField_ansj^10,searchField,productSkn.productSkn_ansj 33 +search.default.field=brandName.brandName_lowercase^2000,smallSort^1000,smallSort.smallSort_pinyin^1000,middleSort^950,middleSort.middleSort_pinyin^950,maxSort^900,maxSort.maxSort_pinyin^900,brandName^900,brandNameCn^850,brandNameCn.brandNameCn_pinyin^850,brandNameEn^800,brandDomain^800,specialSearchField^700,productName.productName_ansj^300,standardOnlyNames.standardOnlyNames_pinyin^250,standardOnlyNames.standardOnlyNames_ansj^250,productKeyword^50,brandKeyword^30,genderS^20,searchField_ansj^10,searchField,productSkn.productSkn_ansj
34 search.script.score=_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8) 34 search.script.score=_score+doc['sortWeight'].value*0.003+(100-doc['breakingRate'].value)/100 * doc['salesWithDateDiff'].value/pow((now-doc['shelveTime'].value)/3600+2,1.8)
35 search.script.lang=groovy 35 search.script.lang=groovy
36 36