Authored by 胡古飞

修改建议词权重

... ... @@ -10,6 +10,7 @@ import com.yoho.search.base.utils.MD5Util;
import com.yoho.search.consumer.index.common.IIndexBuilder;
import com.yoho.search.consumer.service.base.SuggestionKeywordsService;
import com.yoho.search.consumer.service.bo.SuggestIndexBO;
import com.yoho.search.consumer.suggests.common.KeywordType;
import com.yoho.search.dal.model.SuggestionKeywords;
@Component
... ... @@ -31,8 +32,8 @@ public class SuggestIndexBuilder extends IIndexBuilder {
if (kw.getCount() == null || kw.getCount() == 0) {
continue;
}
int type = -1;
int weight = -1;
int type = KeywordType.Customized.getType();
int weight = KeywordType.Customized.getWeightValue();
results.add(new SuggestIndexBO(kw.getKeyword(), type, weight, kw.getCount()));
}
return results;
... ...
... ... @@ -5,10 +5,17 @@ package com.yoho.search.consumer.suggests.common;
*/
public enum KeywordType {
BrandName(1, 8, SuggestionConstants.BRANDNAME_ENABLED_KEY), ShopName(7, 7, SuggestionConstants.SHOPNAME_ENABLED_KEY), SortName(2, 6, SuggestionConstants.SORTNAME_ENABLED_KEY), ProductNameToken(
4, 5, SuggestionConstants.PRODUCTNAME_TOKEN_ENABLED_KEY), ProductName(8, 4, SuggestionConstants.PRODUCTNAME_ENABLED_KEY), ProductKeywordToken(5, 3,
SuggestionConstants.PRODUCTKEYWORD_TOKEN_ENABLED_KEY), BrandKeywordToken(6, 2, SuggestionConstants.BRANDKEYWORD_TOKEN_ENABLED_KEY), HotKeyword(3, 1,
SuggestionConstants.HOTKEYWORD_ENABLED_KEY), Customized(0, 0);
BrandName(1, 8, SuggestionConstants.BRANDNAME_ENABLED_KEY),
ShopName(7, 8, SuggestionConstants.SHOPNAME_ENABLED_KEY),
SortName(2, 8, SuggestionConstants.SORTNAME_ENABLED_KEY),
ProductNameToken(4, 7, SuggestionConstants.PRODUCTNAME_TOKEN_ENABLED_KEY),
ProductKeywordToken(5, 7,SuggestionConstants.PRODUCTKEYWORD_TOKEN_ENABLED_KEY),
BrandKeywordToken(6, 7, SuggestionConstants.BRANDKEYWORD_TOKEN_ENABLED_KEY),
ProductName(8, 1, SuggestionConstants.PRODUCTNAME_ENABLED_KEY),
Customized(0, 1),
HotKeyword(3, 0,SuggestionConstants.HOTKEYWORD_ENABLED_KEY);
private KeywordType(int type, int weightValue) {
this.type = type;
... ...