Showing
9 changed files
with
21 additions
and
17 deletions
@@ -3,7 +3,7 @@ package com.yoho.search.recall.scene.builder.request; | @@ -3,7 +3,7 @@ package com.yoho.search.recall.scene.builder.request; | ||
3 | import com.yoho.search.recall.scene.constants.SknCountConstants; | 3 | import com.yoho.search.recall.scene.constants.SknCountConstants; |
4 | import com.yoho.search.recall.scene.models.ParamQueryFilter; | 4 | import com.yoho.search.recall.scene.models.ParamQueryFilter; |
5 | import com.yoho.search.recall.scene.models.RecallRequest; | 5 | import com.yoho.search.recall.scene.models.RecallRequest; |
6 | -import com.yoho.search.recall.scene.persional.PersionalFactor; | 6 | +import com.yoho.search.recall.scene.models.PersionalFactor; |
7 | import com.yoho.search.recall.scene.strategy.impls.SortPriceStrategy; | 7 | import com.yoho.search.recall.scene.strategy.impls.SortPriceStrategy; |
8 | import org.springframework.stereotype.Component; | 8 | import org.springframework.stereotype.Component; |
9 | 9 |
@@ -4,7 +4,7 @@ import com.yoho.search.base.utils.CollectionUtils; | @@ -4,7 +4,7 @@ import com.yoho.search.base.utils.CollectionUtils; | ||
4 | import com.yoho.search.recall.scene.models.RecallSknParams; | 4 | import com.yoho.search.recall.scene.models.RecallSknParams; |
5 | import com.yoho.search.recall.scene.models.RecallResponseBatch; | 5 | import com.yoho.search.recall.scene.models.RecallResponseBatch; |
6 | import com.yoho.search.recall.scene.models.RecallSknList; | 6 | import com.yoho.search.recall.scene.models.RecallSknList; |
7 | -import com.yoho.search.recall.scene.persional.PersionalFactor; | 7 | +import com.yoho.search.recall.scene.models.PersionalFactor; |
8 | import com.yoho.search.recall.scene.strategy.StrategyNameEnum; | 8 | import com.yoho.search.recall.scene.strategy.StrategyNameEnum; |
9 | import com.yoho.search.service.base.ProductListSortKey; | 9 | import com.yoho.search.service.base.ProductListSortKey; |
10 | import com.yoho.search.service.base.ProductListSortService; | 10 | import com.yoho.search.service.base.ProductListSortService; |
@@ -9,8 +9,8 @@ import com.yoho.search.recall.scene.models.RecallRequest; | @@ -9,8 +9,8 @@ import com.yoho.search.recall.scene.models.RecallRequest; | ||
9 | import com.yoho.search.recall.scene.models.RecallResponseBatch; | 9 | import com.yoho.search.recall.scene.models.RecallResponseBatch; |
10 | import com.yoho.search.recall.scene.models.RecallSknParams; | 10 | import com.yoho.search.recall.scene.models.RecallSknParams; |
11 | import com.yoho.search.recall.scene.models.RecallSknList; | 11 | import com.yoho.search.recall.scene.models.RecallSknList; |
12 | -import com.yoho.search.recall.scene.persional.PersionalFactor; | ||
13 | -import com.yoho.search.recall.scene.persional.RecallPersionalService; | 12 | +import com.yoho.search.recall.scene.models.PersionalFactor; |
13 | +import com.yoho.search.recall.scene.persional.PersionalFactorService; | ||
14 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
15 | import org.springframework.stereotype.Component; | 15 | import org.springframework.stereotype.Component; |
16 | 16 | ||
@@ -23,7 +23,7 @@ import java.util.Map; | @@ -23,7 +23,7 @@ import java.util.Map; | ||
23 | public class CacheRecallSknParamsRecallSknListBean extends AbstractCacheRequestResponseComponent<RecallSknParams,RecallSknList,CacheRecallSknParamsRecallSknList> { | 23 | public class CacheRecallSknParamsRecallSknListBean extends AbstractCacheRequestResponseComponent<RecallSknParams,RecallSknList,CacheRecallSknParamsRecallSknList> { |
24 | 24 | ||
25 | @Autowired | 25 | @Autowired |
26 | - private RecallPersionalService recallPersionalService; | 26 | + private PersionalFactorService persionalFactorService; |
27 | @Autowired | 27 | @Autowired |
28 | private CacheRecallRequestRecallResponseBean cacheRecallRequestResponseBean; | 28 | private CacheRecallRequestRecallResponseBean cacheRecallRequestResponseBean; |
29 | @Autowired | 29 | @Autowired |
@@ -74,7 +74,7 @@ public class CacheRecallSknParamsRecallSknListBean extends AbstractCacheRequestR | @@ -74,7 +74,7 @@ public class CacheRecallSknParamsRecallSknListBean extends AbstractCacheRequestR | ||
74 | */ | 74 | */ |
75 | private RecallSknList doRealRecall(RecallSknParams param) { | 75 | private RecallSknList doRealRecall(RecallSknParams param) { |
76 | //1、获取个性化因子 | 76 | //1、获取个性化因子 |
77 | - PersionalFactor persionalFactor = recallPersionalService.queryPersionalFactor(param); | 77 | + PersionalFactor persionalFactor = persionalFactorService.queryPersionalFactor(param); |
78 | //2、构造请求 | 78 | //2、构造请求 |
79 | List<RecallRequest> batchRequests = this.buildBatchRequests(param, persionalFactor); | 79 | List<RecallRequest> batchRequests = this.buildBatchRequests(param, persionalFactor); |
80 | //3、批量召回 | 80 | //3、批量召回 |
1 | -package com.yoho.search.recall.scene.persional; | 1 | +package com.yoho.search.recall.scene.models; |
2 | 2 | ||
3 | import java.io.Serializable; | 3 | import java.io.Serializable; |
4 | import java.util.List; | 4 | import java.util.List; |
5 | 5 | ||
6 | +/** | ||
7 | + * 个性化因子参数 | ||
8 | + */ | ||
6 | public class PersionalFactor implements Serializable{ | 9 | public class PersionalFactor implements Serializable{ |
7 | 10 | ||
8 | private static final long serialVersionUID = 89030356435559223L; | 11 | private static final long serialVersionUID = 89030356435559223L; |
@@ -7,10 +7,9 @@ import com.yoho.search.common.cache.model.SearchCache; | @@ -7,10 +7,9 @@ import com.yoho.search.common.cache.model.SearchCache; | ||
7 | import com.yoho.search.core.es.model.SearchParam; | 7 | import com.yoho.search.core.es.model.SearchParam; |
8 | import com.yoho.search.core.es.model.SearchResult; | 8 | import com.yoho.search.core.es.model.SearchResult; |
9 | import com.yoho.search.recall.scene.models.ParamQueryFilter; | 9 | import com.yoho.search.recall.scene.models.ParamQueryFilter; |
10 | +import com.yoho.search.recall.scene.models.PersionalFactor; | ||
10 | import com.yoho.search.service.base.SearchCacheService; | 11 | import com.yoho.search.service.base.SearchCacheService; |
11 | import com.yoho.search.service.base.SearchCommonService; | 12 | import com.yoho.search.service.base.SearchCommonService; |
12 | -import org.elasticsearch.index.query.BoolQueryBuilder; | ||
13 | -import org.elasticsearch.index.query.QueryBuilder; | ||
14 | import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; | 13 | import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; |
15 | import org.elasticsearch.search.aggregations.Aggregation; | 14 | import org.elasticsearch.search.aggregations.Aggregation; |
16 | import org.elasticsearch.search.aggregations.AggregationBuilders; | 15 | import org.elasticsearch.search.aggregations.AggregationBuilders; |
@@ -26,7 +25,7 @@ import java.util.List; | @@ -26,7 +25,7 @@ import java.util.List; | ||
26 | import java.util.Map; | 25 | import java.util.Map; |
27 | 26 | ||
28 | @Component | 27 | @Component |
29 | -class PersionalFactorPageComponent { | 28 | +class PagePersionalFactorComponent { |
30 | 29 | ||
31 | @Autowired | 30 | @Autowired |
32 | private SearchCommonService searchCommonService; | 31 | private SearchCommonService searchCommonService; |
1 | package com.yoho.search.recall.scene.persional; | 1 | package com.yoho.search.recall.scene.persional; |
2 | 2 | ||
3 | +import com.yoho.search.recall.scene.models.PersionalFactor; | ||
3 | import com.yoho.search.recall.scene.models.RecallSknParams; | 4 | import com.yoho.search.recall.scene.models.RecallSknParams; |
4 | import org.slf4j.Logger; | 5 | import org.slf4j.Logger; |
5 | import org.slf4j.LoggerFactory; | 6 | import org.slf4j.LoggerFactory; |
@@ -10,14 +11,14 @@ import java.util.ArrayList; | @@ -10,14 +11,14 @@ import java.util.ArrayList; | ||
10 | import java.util.List; | 11 | import java.util.List; |
11 | 12 | ||
12 | @Component | 13 | @Component |
13 | -public class RecallPersionalService { | 14 | +public class PersionalFactorService { |
14 | 15 | ||
15 | - private static final Logger logger = LoggerFactory.getLogger(RecallPersionalService.class); | 16 | + private static final Logger logger = LoggerFactory.getLogger(PersionalFactorService.class); |
16 | 17 | ||
17 | @Autowired | 18 | @Autowired |
18 | - private PersionalFactorPageComponent pageComponent; | 19 | + private PagePersionalFactorComponent pageComponent; |
19 | @Autowired | 20 | @Autowired |
20 | - private PersionalFactorUserComponent userComponent; | 21 | + private UserPersionalFactorComponent userComponent; |
21 | 22 | ||
22 | /** | 23 | /** |
23 | * 获取个性化因子 | 24 | * 获取个性化因子 |
1 | package com.yoho.search.recall.scene.persional; | 1 | package com.yoho.search.recall.scene.persional; |
2 | 2 | ||
3 | +import com.yoho.search.recall.scene.models.PersionalFactor; | ||
3 | import org.springframework.stereotype.Component; | 4 | import org.springframework.stereotype.Component; |
4 | 5 | ||
5 | import java.util.ArrayList; | 6 | import java.util.ArrayList; |
6 | import java.util.List; | 7 | import java.util.List; |
7 | 8 | ||
8 | @Component | 9 | @Component |
9 | -class PersionalFactorUserComponent { | 10 | +class UserPersionalFactorComponent { |
10 | 11 | ||
11 | /** | 12 | /** |
12 | * 获取用户的个性化因子 | 13 | * 获取用户的个性化因子 |
@@ -2,7 +2,7 @@ package com.yoho.search.recall.scene.strategy.helper; | @@ -2,7 +2,7 @@ package com.yoho.search.recall.scene.strategy.helper; | ||
2 | 2 | ||
3 | import com.yoho.search.base.utils.DateUtil; | 3 | import com.yoho.search.base.utils.DateUtil; |
4 | import com.yoho.search.base.utils.ProductIndexEsField; | 4 | import com.yoho.search.base.utils.ProductIndexEsField; |
5 | -import com.yoho.search.recall.scene.persional.PersionalFactor; | 5 | +import com.yoho.search.recall.scene.models.PersionalFactor; |
6 | import org.apache.lucene.search.join.ScoreMode; | 6 | import org.apache.lucene.search.join.ScoreMode; |
7 | import org.elasticsearch.index.query.BoolQueryBuilder; | 7 | import org.elasticsearch.index.query.BoolQueryBuilder; |
8 | import org.elasticsearch.index.query.QueryBuilder; | 8 | import org.elasticsearch.index.query.QueryBuilder; |
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON; | @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON; | ||
4 | import com.yoho.search.recall.scene.constants.CacheTimeConstants; | 4 | import com.yoho.search.recall.scene.constants.CacheTimeConstants; |
5 | import com.yoho.search.recall.scene.strategy.helper.ExtendFilterHelper; | 5 | import com.yoho.search.recall.scene.strategy.helper.ExtendFilterHelper; |
6 | import com.yoho.search.recall.scene.strategy.helper.SortBuilderHelper; | 6 | import com.yoho.search.recall.scene.strategy.helper.SortBuilderHelper; |
7 | -import com.yoho.search.recall.scene.persional.PersionalFactor; | 7 | +import com.yoho.search.recall.scene.models.PersionalFactor; |
8 | import com.yoho.search.recall.scene.strategy.IStrategy; | 8 | import com.yoho.search.recall.scene.strategy.IStrategy; |
9 | import com.yoho.search.recall.scene.strategy.StrategyNameEnum; | 9 | import com.yoho.search.recall.scene.strategy.StrategyNameEnum; |
10 | import org.elasticsearch.index.query.QueryBuilder; | 10 | import org.elasticsearch.index.query.QueryBuilder; |
-
Please register or login to post a comment