|
@@ -37,9 +37,10 @@ public class SearchLikeHelper { |
|
@@ -37,9 +37,10 @@ public class SearchLikeHelper { |
37
|
public List<SearchFieldBoost> searchFieldBoosts = new ArrayList<SearchFieldBoost>();
|
37
|
public List<SearchFieldBoost> searchFieldBoosts = new ArrayList<SearchFieldBoost>();
|
38
|
|
38
|
|
39
|
private int sortMaxBoost = 1000;
|
39
|
private int sortMaxBoost = 1000;
|
|
|
40
|
+ private int elementsBoost = 700;
|
|
|
41
|
+ private int standardOnlyNamesBoost = 600;
|
|
|
42
|
+ private int productNameMaxBoost = 500;
|
40
|
private int brandMaxBoost = 400;
|
43
|
private int brandMaxBoost = 400;
|
41
|
- private int productNameMaxBoost = 600;
|
|
|
42
|
- private int standardOnlyNamesBoost = 700;
|
|
|
43
|
private int otherBoost = 200;
|
44
|
private int otherBoost = 200;
|
44
|
|
45
|
|
45
|
private void addSearchFieldBoost(List<String> searchFields, float maxBoost) {
|
46
|
private void addSearchFieldBoost(List<String> searchFields, float maxBoost) {
|
|
@@ -68,6 +69,10 @@ public class SearchLikeHelper { |
|
@@ -68,6 +69,10 @@ public class SearchLikeHelper { |
68
|
searchFields = Arrays.asList("standardOnlyNames.standardOnlyNames_ansj", "standardOnlyNames.standardOnlyNames_pinyin");
|
69
|
searchFields = Arrays.asList("standardOnlyNames.standardOnlyNames_ansj", "standardOnlyNames.standardOnlyNames_pinyin");
|
69
|
this.addSearchFieldBoost(searchFields, standardOnlyNamesBoost);
|
70
|
this.addSearchFieldBoost(searchFields, standardOnlyNamesBoost);
|
70
|
|
71
|
|
|
|
72
|
+ // 工艺元素权重
|
|
|
73
|
+ searchFields = Arrays.asList("pattern", "style", "attributeNames");
|
|
|
74
|
+ this.addSearchFieldBoost(searchFields, elementsBoost);
|
|
|
75
|
+
|
71
|
// 其他字段权重
|
76
|
// 其他字段权重
|
72
|
searchFields = Arrays.asList("specialSearchField", "productKeyword", "brandKeyword", "genderS", "searchField_ansj", "searchField");
|
77
|
searchFields = Arrays.asList("specialSearchField", "productKeyword", "brandKeyword", "genderS", "searchField_ansj", "searchField");
|
73
|
this.addSearchFieldBoost(searchFields, otherBoost);
|
78
|
this.addSearchFieldBoost(searchFields, otherBoost);
|
|
@@ -167,7 +172,7 @@ public class SearchLikeHelper { |
|
@@ -167,7 +172,7 @@ public class SearchLikeHelper { |
167
|
}
|
172
|
}
|
168
|
return boolFilter;
|
173
|
return boolFilter;
|
169
|
}
|
174
|
}
|
170
|
-
|
175
|
+
|
171
|
public List<String> getGenderInfo(String gender) {
|
176
|
public List<String> getGenderInfo(String gender) {
|
172
|
if ("1".equals(gender)) {
|
177
|
if ("1".equals(gender)) {
|
173
|
return Arrays.asList("1", "3");
|
178
|
return Arrays.asList("1", "3");
|