|
|
package com.yoho.search.service.recall.beans;
|
|
|
package com.yoho.search.service.recall.beans.result;
|
|
|
|
|
|
import com.yoho.search.base.utils.SearchCollectionUtils;
|
|
|
import com.yoho.search.base.utils.Transfer;
|
|
|
import com.yoho.search.core.personalized.models.PersonalizedSearch;
|
|
|
import com.yoho.search.core.personalized.models.SortPriceAreas;
|
|
|
import com.yoho.search.models.recall.*;
|
|
|
import com.yoho.search.service.base.SknBaseInfoBaseService;
|
|
|
import com.yoho.search.service.helper.ProductListSortHelper;
|
|
|
import com.yoho.search.service.helper.ProductListSortKey;
|
|
|
import com.yoho.search.service.recall.beans.RecallConfigService;
|
|
|
import com.yoho.search.service.recall.helper.RecallConfigConstants;
|
|
|
import com.yoho.search.service.recall.helper.StrategyHelper;
|
|
|
import com.yoho.search.service.recall.helper.W2vFeatureCalculator;
|
|
|
import com.yoho.search.models.recall.RecallMergerResult;
|
|
|
import com.yoho.search.models.recall.RecallSknInfo;
|
|
|
import com.yoho.search.models.recall.UserFeatureFactor;
|
|
|
import com.yoho.search.models.recall.UserPersonalFactor;
|
|
|
import com.yoho.search.models.recall.SknBaseInfoResponse;
|
|
|
import com.yoho.search.models.recall.UserRecallRequest;
|
|
|
import com.yoho.search.models.recall.UserRecallResponse;
|
|
|
import com.yoho.search.service.recall.strategy.StrategyEnum;
|
|
|
import com.yoho.search.service.scorer.personal.PersonalVectorFeatureSearch;
|
|
|
import org.slf4j.Logger;
|
...
|
...
|
@@ -33,6 +28,8 @@ public class UserRecallResponseResultBuilder { |
|
|
private static final Logger RECALL_NEW_LOGGER = LoggerFactory.getLogger("RECALL");
|
|
|
|
|
|
@Autowired
|
|
|
private RecallMergerResultBuilder recallMergerResultBuilder;
|
|
|
@Autowired
|
|
|
private PersonalVectorFeatureSearch personalVectorFeatureSearch;
|
|
|
@Autowired
|
|
|
private SknBaseInfoBaseService sknBaseInfoBaseService;
|
...
|
...
|
@@ -43,12 +40,16 @@ public class UserRecallResponseResultBuilder { |
|
|
|
|
|
/**
|
|
|
* 构造真实的UserRecallResponse
|
|
|
* @param recallMergerResult
|
|
|
*
|
|
|
* @param requestResponses
|
|
|
* @param userRecallRequest
|
|
|
* @param userPersonalFactor
|
|
|
* @return
|
|
|
*/
|
|
|
public UserRecallResponse buildUserRecallResponse(RecallMergerResult recallMergerResult, UserRecallRequest userRecallRequest, UserPersonalFactor userPersonalFactor) {
|
|
|
public UserRecallResponse buildUserRecallResponse(List<RecallRequestResponse> requestResponses, UserRecallRequest userRecallRequest, UserPersonalFactor userPersonalFactor) {
|
|
|
//0、去重加处理策略
|
|
|
RecallMergerResult recallMergerResult = recallMergerResultBuilder.buildRecallMergerResult(requestResponses);
|
|
|
|
|
|
//1、获取总数
|
|
|
final long total = recallMergerResult.getTotal();
|
|
|
|
...
|
...
|
@@ -80,7 +81,7 @@ public class UserRecallResponseResultBuilder { |
|
|
}
|
|
|
sknResultList = SearchCollectionUtils.safeSubList(sknResultList, 0, recallTotalPage * pageSize);//为用户最多保留X个skn进缓存
|
|
|
|
|
|
RECALL_NEW_LOGGER.info("total recall skn count after merger2 is [{}],recallTotalPage is[{}] ", sknResultList.size(),recallTotalPage);
|
|
|
RECALL_NEW_LOGGER.info("total recall skn count after merger2 is [{}],recallTotalPage is[{}] ", sknResultList.size(), recallTotalPage);
|
|
|
|
|
|
//9、添加日志
|
|
|
if (userRecallRequest.openDetailLog()) {
|
...
|
...
|
|