Authored by hugufei

重命名PagePersonalFactor

... ... @@ -4,7 +4,6 @@ import com.yoho.search.core.personalized.models.SortPriceArea;
import com.yoho.search.recall.scene.constants.SknCountConstants;
import com.yoho.search.recall.scene.models.ParamQueryFilter;
import com.yoho.search.recall.scene.models.RecallRequest;
import com.yoho.search.recall.scene.models.PagePersionalFactor;
import com.yoho.search.recall.scene.beans.strategy.impls.SortPriceStrategy;
import org.springframework.stereotype.Component;
... ...
... ... @@ -3,7 +3,6 @@ package com.yoho.search.recall.scene.beans.helper;
import com.yoho.search.base.utils.DateUtil;
import com.yoho.search.base.utils.ProductIndexEsField;
import com.yoho.search.core.personalized.models.SortPriceArea;
import com.yoho.search.recall.scene.models.PagePersionalFactor;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
... ...
... ... @@ -8,7 +8,7 @@ import com.yoho.search.core.es.model.SearchParam;
import com.yoho.search.core.es.model.SearchResult;
import com.yoho.search.core.personalized.models.SortPriceArea;
import com.yoho.search.recall.scene.models.ParamQueryFilter;
import com.yoho.search.recall.scene.models.PagePersionalFactor;
import com.yoho.search.recall.scene.models.PagePersonalFactor;
import com.yoho.search.service.base.SearchCacheService;
import com.yoho.search.service.base.SearchCommonService;
import org.elasticsearch.search.aggregations.AbstractAggregationBuilder;
... ... @@ -48,7 +48,7 @@ class PagePersionalFactorComponent {
* @param paramQueryFilter
* @return
*/
public PagePersionalFactor queryPagePersionalFactor(ParamQueryFilter paramQueryFilter) {
public PagePersonalFactor queryPagePersionalFactor(ParamQueryFilter paramQueryFilter) {
//0、构造参数
SearchParam searchParam = new SearchParam();
searchParam.setQuery(paramQueryFilter.getParamQuery());
... ... @@ -68,9 +68,9 @@ class PagePersionalFactorComponent {
//3、缓存中获取
String cacheKey = searchCacheService.genSearchParamString(ISearchConstants.INDEX_NAME_PRODUCT_INDEX,searchParam);
PagePersionalFactor pagePagePersionalFactor = searchCacheService.getSerializableObjectFromCache(searchCache,cacheKey,PagePersionalFactor.class,true);
if(pagePagePersionalFactor !=null) {
return pagePagePersionalFactor;
PagePersonalFactor pagePagePersonalFactor = searchCacheService.getSerializableObjectFromCache(searchCache,cacheKey,PagePersonalFactor.class,true);
if(pagePagePersonalFactor !=null) {
return pagePagePersonalFactor;
}
//4、执行查询
... ... @@ -80,10 +80,10 @@ class PagePersionalFactorComponent {
Map<String, Aggregation> aggregationMap = searchResult.getAggMaps();
List<Integer> brandIds = this.getBrandIdsFromAggregationMap(aggregationMap);
List<SortPriceArea> sortPriceAreas = this.getSortPriceAreasFromAggregationMap(aggregationMap);
pagePagePersionalFactor = new PagePersionalFactor(brandIds, sortPriceAreas);
pagePagePersonalFactor = new PagePersonalFactor(brandIds, sortPriceAreas);
//6、加入缓存
searchCacheService.addSerializableObjectToCache(searchCache,cacheKey, pagePagePersionalFactor,true);
return pagePagePersionalFactor;
searchCacheService.addSerializableObjectToCache(searchCache,cacheKey, pagePagePersonalFactor,true);
return pagePagePersonalFactor;
}
private List<Integer> getBrandIdsFromAggregationMap(Map<String, Aggregation> aggregationMap) {
... ...
... ... @@ -4,7 +4,7 @@ import com.yoho.search.base.utils.CollectionUtils;
import com.yoho.search.base.utils.Transfer;
import com.yoho.search.core.personalized.models.SortPriceArea;
import com.yoho.search.core.personalized.models.UserPersonalFactorRsp;
import com.yoho.search.recall.scene.models.PagePersionalFactor;
import com.yoho.search.recall.scene.models.PagePersonalFactor;
import com.yoho.search.recall.scene.models.RecallParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -34,7 +34,7 @@ public class QueryUserPersionalFactorBean {
public UserPersonalFactorRsp queryPersionalFactor(RecallParams recallParams) {
try {
//1、获取页面上的个性化因子
PagePersionalFactor pageFactor = pageComponent.queryPagePersionalFactor(recallParams.getParamQueryFilter());
PagePersonalFactor pageFactor = pageComponent.queryPagePersionalFactor(recallParams.getParamQueryFilter());
//2、获取用户的个性化因子
UserPersonalFactorRsp userFactor = userComponent.queryUserPersionalFactor(recallParams.getUid(), recallParams.getUdid());
//3、join获取最终的结果
... ...
... ... @@ -5,7 +5,6 @@ import com.yoho.search.core.personalized.models.SortPriceArea;
import com.yoho.search.recall.scene.constants.CacheTimeConstants;
import com.yoho.search.recall.scene.beans.helper.ExtendFilterHelper;
import com.yoho.search.recall.scene.beans.helper.SortBuilderHelper;
import com.yoho.search.recall.scene.models.PagePersionalFactor;
import com.yoho.search.recall.scene.beans.strategy.IStrategy;
import com.yoho.search.recall.scene.beans.strategy.StrategyNameEnum;
import org.elasticsearch.index.query.QueryBuilder;
... ...
... ... @@ -8,17 +8,17 @@ import java.util.List;
/**
* 个性化因子参数
*/
public class PagePersionalFactor implements Serializable{
public class PagePersonalFactor implements Serializable{
private static final long serialVersionUID = 89030356435559223L;
private List<Integer> brandIds;
private List<SortPriceArea> sortPriceAreas;
public PagePersionalFactor() {
public PagePersonalFactor() {
}
public PagePersionalFactor(List<Integer> brandIds, List<SortPriceArea> sortPriceAreas){
public PagePersonalFactor(List<Integer> brandIds, List<SortPriceArea> sortPriceAreas){
this.brandIds = brandIds;
this.sortPriceAreas = sortPriceAreas;
}
... ...