Authored by hugufei

fix ConsumerConfiger

package com.yoho.search.consumer.suggests.common;
import com.yoho.search.base.beans.SearchPropertyPlaceholderConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class ConsumerConfiger {
@Autowired
private SearchPropertyPlaceholderConfigurer configurer;
/******************************for full build**************************************/
public int getSearchIndexBatchLimit(){
return configurer.getInt("search.index.batch.limit", 5000);
}
public int getSearchIndexBatchMaxThreadSize(){
return configurer.getInt("search.index.batch.max.thread.size", 5);
}
/******************************for tbl**************************************/
public String getTblProductUrl(){
return configurer.getString("tbl.product.url", "http://test.soa.global.yohobuy.com/product/api/v1/detail/");
}
public String getTblPrimaryKey(){
return configurer.getString("tbl.product.private.key", "a85bb0674e08986c6b115d5e3a4884fa");
}
public String getTblAdaptorDomain(){
return configurer.getString("tpl.adaptor.domain", "http://192.168.102.224:8085/search-adaptor");
}
/******************************for Suggestion**************************************/
public int getSuggestionCountBatchLimit (){
return configurer.getInt("suggestion.count.batch.limit", 300);
}
public int getSuggestionCountBatchMaxThreadSize(){
return configurer.getInt("suggestion.count.batch.max.thread.size", 1);
}
public int getSuggestionDiscoverBatchLimit(){
return configurer.getInt("suggestion.discover.batch.limit", 500);
}
public int getSuggestionDiscoverBatchMaxThreadSize(){
return configurer.getInt("suggestion.discover.batch.max.thread.size", 3);
}
/******************************for search**************************************/
public List<String> getSearchDefaultField(){
return configurer.getList("search.default.field");
}
public String getSearchMultiMatchQueryType(){
return configurer.getString("search.multiMatchQuery.type", "BEST_FIELDS");
}
public String getSearchOperator(){
return configurer.getString("search.operator", "or");
}
public String getSearchMinimumShouldMatch(){
return configurer.getString("search.minimum.should.match", "75%");
}
}
package com.yoho.search.consumer.common;
import com.yoho.search.base.beans.SearchPropertyPlaceholderConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class ConsumerConfiger {
@Autowired
private SearchPropertyPlaceholderConfigurer configurer;
/******************************for full build**************************************/
public int getSearchIndexBatchLimit(){
return configurer.getInt("search.index.batch.limit", 5000);
}
public int getSearchIndexBatchMaxThreadSize(){
return configurer.getInt("search.index.batch.max.thread.size", 5);
}
/******************************for tbl**************************************/
public String getTblProductUrl(){
return configurer.getString("tbl.product.url", "http://test.soa.global.yohobuy.com/product/api/v1/detail/");
}
public String getTblPrimaryKey(){
return configurer.getString("tbl.product.private.key", "a85bb0674e08986c6b115d5e3a4884fa");
}
public String getTblAdaptorDomain(){
return configurer.getString("tpl.adaptor.domain", "http://192.168.102.224:8085/search-adaptor");
}
/******************************for Suggestion**************************************/
public int getSuggestionCountBatchLimit (){
return configurer.getInt("suggestion.count.batch.limit", 300);
}
public int getSuggestionCountBatchMaxThreadSize(){
return configurer.getInt("suggestion.count.batch.max.thread.size", 1);
}
public int getSuggestionDiscoverBatchLimit(){
return configurer.getInt("suggestion.discover.batch.limit", 500);
}
public int getSuggestionDiscoverBatchMaxThreadSize(){
return configurer.getInt("suggestion.discover.batch.max.thread.size", 3);
}
/******************************for search**************************************/
public List<String> getSearchDefaultField(){
return configurer.getList("search.default.field");
}
public String getSearchMultiMatchQueryType(){
return configurer.getString("search.multiMatchQuery.type", "BEST_FIELDS");
}
public String getSearchOperator(){
return configurer.getString("search.operator", "or");
}
public String getSearchMinimumShouldMatch(){
return configurer.getString("search.minimum.should.match", "75%");
}
}
... ...
... ... @@ -9,7 +9,7 @@ import java.util.concurrent.Future;
import javax.annotation.PostConstruct;
import com.yoho.search.consumer.suggests.common.ConsumerConfiger;
import com.yoho.search.consumer.common.ConsumerConfiger;
import org.elasticsearch.action.bulk.BulkResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ...
... ... @@ -6,7 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.search.base.utils.HttpClientUtils;
import com.yoho.search.base.utils.MD5Util;
import com.yoho.search.consumer.index.common.IIndexBuilder;
import com.yoho.search.consumer.suggests.common.ConsumerConfiger;
import com.yoho.search.consumer.common.ConsumerConfiger;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ...
... ... @@ -4,7 +4,7 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import com.yoho.search.consumer.suggests.common.ConsumerConfiger;
import com.yoho.search.consumer.common.ConsumerConfiger;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -15,7 +15,6 @@ import org.springframework.stereotype.Component;
import com.yoho.search.base.utils.DateStyle;
import com.yoho.search.base.utils.DateUtil;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.index.increment.flow.ProductIndexFeatureVectorUpdateFlow;
import com.yoho.search.consumer.service.daoService.ProductVectorFeatureService;
import com.yoho.search.consumer.service.logicService.personal.PersonalVectorVersionManager;
... ...
package com.yoho.search.consumer.job;
import com.yoho.search.consumer.suggests.common.ConsumerConfiger;
import com.yoho.search.consumer.common.ConsumerConfiger;
import com.yoho.search.consumer.suggests.common.RetryBusinessFlowExecutor;
import com.yoho.search.consumer.suggests.common.SuggestionCache;
import com.yoho.search.consumer.suggests.common.SuggestionConstants;
import com.yoho.search.consumer.suggests.counter.AbstractSuggestionCounter;
import com.yoho.search.consumer.suggests.discover.AbstractSuggestionDiscoverer;
import org.slf4j.Logger;
... ...
... ... @@ -10,7 +10,7 @@ import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.index.common.IYohoIndexService;
import com.yoho.search.consumer.service.bo.ProductIndexBO;
import com.yoho.search.consumer.service.logicService.ProductIndexBOToMapService;
import com.yoho.search.consumer.suggests.common.ConsumerConfiger;
import com.yoho.search.consumer.common.ConsumerConfiger;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import org.apache.commons.lang3.StringUtils;
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.search.consumer.suggests.common;
import java.util.List;
import com.yoho.search.consumer.common.ConsumerConfiger;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.MultiMatchQueryBuilder;
... ... @@ -10,7 +11,6 @@ import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import com.yoho.search.base.utils.ConvertUtils;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.suggests.counter.CountUsage;
import com.yoho.search.core.es.model.SearchParam;
import org.springframework.beans.factory.annotation.Autowired;
... ...
package com.yoho.search.consumer.suggests.common;
import com.yoho.search.base.utils.CharUtils;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.common.ConsumerConfiger;
import com.yoho.search.consumer.service.daoService.SuggestWordDefService;
import com.yoho.search.dal.model.SuggestWordDef;
import org.apache.commons.lang3.StringUtils;
... ...
package com.yoho.search.consumer.suggests.discover;
import com.yoho.search.consumer.common.ConsumerConfiger;
import com.yoho.search.consumer.common.DynamicConfigService;
import com.yoho.search.consumer.index.rebuild.RebuildFlagService;
import com.yoho.search.consumer.service.daoService.SuggestWordDefService;
... ...