Authored by wangnan

Merge branch '1215' of http://git.yoho.cn/yoho-search/yoho-search-consumer into 1215

... ... @@ -46,7 +46,6 @@ public class IndexRebuildJob implements ApplicationEventPublisherAware {
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_ROBOTQUESTION);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_PRODUCT_PRICE_PLAN);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_HELPER);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_SUGGEST);
this.rebuildIndexWithlog(ISearchConstants.INDEX_NAME_SHOPS);
try {
... ...
... ... @@ -189,6 +189,7 @@ public class IndexController implements ApplicationEventPublisherAware {
}
indexRebuildJob.rebuildTblProductIndex();
indexRebuildJob.execute();
suggestionDiscoveryJob.execute();
suggestionCounterJob.execute();
indexRebuildJob.rebuildSuggestIndex();
return getResultMap(200, "rebuildAll success");
... ...
... ... @@ -26,9 +26,9 @@ public class SuggestionConstants {
public static int SUGGESTION_COUNT_BATCH_LIMIT = Configuration.getInt("suggestion.count.batch.limit", 300);
public static int SUGGESTION_COUNT_BATCH_MAX_THREAD_SIZE = Configuration.getInt("suggestion.count.batch.max.thread.size", 3);
public static int SUGGESTION_COUNT_BATCH_MAX_THREAD_SIZE = Configuration.getInt("suggestion.count.batch.max.thread.size", 1);
public static int SUGGESTION_DISCOVER_BATCH_LIMIT = Configuration.getInt("suggestion.discover.batch.limit", 300);
public static int SUGGESTION_DISCOVER_BATCH_LIMIT = Configuration.getInt("suggestion.discover.batch.limit", 500);
public static int SUGGESTION_DISCOVER_BATCH_MAX_THREAD_SIZE = Configuration.getInt("suggestion.discover.batch.max.thread.size", 3);
... ...
... ... @@ -60,7 +60,7 @@ public abstract class AbstractSuggestionCounter implements ApplicationEventPubli
}
Map<String, Integer> filterMap = filter(pageNo, countMap);
logger.info("[{} business][pageNo={}][fetchWordSize={}][countMapSize={}][countMapSize={}]", flowName(), pageNo, fetchSize, countMapSize, filterMap.size());
logger.info("[{} business][pageNo={}][fetchWordSize={}][countMapSize={}][filterMapSize={}]", flowName(), pageNo, fetchSize, countMapSize, filterMap.size());
logger.trace("[{} business][pageNo={}][keywordMap={}][countMap={}][filterMap={}]", flowName(), pageNo, keywordMap, countMap, filterMap);
return persistence(keywordMap, filterMap);
}
... ...
... ... @@ -57,9 +57,11 @@ public class SuggestionKeywordCounter extends AbstractSuggestionCounter {
Map<String, Integer> resultMap = super.filter(pageNo, countMap);
// 检查一些不友好的推荐词 输出到日志中
List<String> notNormalWords = resultMap.keySet().stream().filter(keyword -> notNormalKeyword(keyword)).collect(Collectors.toList());
if (notNormalWords != null && !notNormalWords.isEmpty()) {
logger.warn("found not normal words: {}", notNormalWords.stream().map(item -> "'" + item + "'").collect(Collectors.joining(",")));
if (logger.isInfoEnabled()) {
List<String> notNormalWords = resultMap.keySet().stream().filter(keyword -> notNormalKeyword(keyword)).collect(Collectors.toList());
if (notNormalWords != null && !notNormalWords.isEmpty()) {
logger.info("[{} check][pageNo={}]found not normal words: {}", flowName(), pageNo, notNormalWords.stream().map(item -> "'" + item + "'").collect(Collectors.joining(",")));
}
}
return resultMap;
... ...
... ... @@ -56,5 +56,9 @@ search.multiMatchQuery.type=BEST_FIELDS
#suggestion
suggestion.count.batch.limit=300
suggestion.count.batch.max.thread.size=3
suggestion.count.batch.max.thread.size=1
suggestion.discover.batch.limit=500
suggestion.discover.batch.max.thread.size=3
suggestion.count.agg.size=10000
suggestion.count.agg.mindoc=5
... ...
... ... @@ -58,4 +58,8 @@ search.multiMatchQuery.type=BEST_FIELDS
#suggestion
suggestion.count.batch.limit=${suggestion.count.batch.limit}
suggestion.count.batch.max.thread.size=${suggestion.count.batch.max.thread.size}
\ No newline at end of file
suggestion.count.batch.max.thread.size=${suggestion.count.batch.max.thread.size}
suggestion.discover.batch.limit=${suggestion.discover.batch.limit}
suggestion.discover.batch.max.thread.size=${suggestion.discover.batch.max.thread.size}
suggestion.count.agg.size=${suggestion.count.agg.size}
suggestion.count.agg.mindoc=${suggestion.count.agg.mindoc}
\ No newline at end of file
... ...