|
|
package com.yoho.search.recall.scene.request;
|
|
|
|
|
|
import com.yoho.search.recall.scene.config.RecallConstants;
|
|
|
import com.yoho.search.recall.scene.constants.RecallConstants;
|
|
|
import com.yoho.search.recall.scene.models.RecallRequest;
|
|
|
import com.yoho.search.recall.scene.strategy.StrategyNameEnum;
|
|
|
import com.yoho.search.recall.scene.strategy.impls.BrandHeatValueStrategy;
|
|
|
import com.yoho.search.recall.scene.strategy.impls.BrandNewShelveStrategy;
|
|
|
import com.yoho.search.recall.scene.strategy.impls.BrandPromotionStrategy;
|
|
|
import com.yoho.search.recall.scene.strategy.impls.BrandReducePriceStrategy;
|
|
|
import com.yoho.search.recall.sort.strategy.*;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilder;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Component
|
...
|
...
|
@@ -31,19 +28,19 @@ public class BrandRecallRequestBuilder extends BaseRecallRequest{ |
|
|
List<RecallRequest> requests = new ArrayList<>();
|
|
|
// 1) 人气
|
|
|
for (Integer brandId : brandIds) {
|
|
|
requests.add(this.buildBrandHeatValueRequest(query, filter, brandId, RecallConstants.RECALL_SKN_COUNT_PER_BRAND));
|
|
|
requests.add(this.buildBrandHeatValueRequest(query, filter, brandId, RecallConstants.RECALL_SKN_COUNT_PER_BRAND_HEATVALUE));
|
|
|
}
|
|
|
// 2) 新品
|
|
|
for (Integer brandId : brandIds) {
|
|
|
requests.add(this.buildBrandNewShelveRequest(query, filter, brandId, RecallConstants.RECALL_SKN_COUNT_PER_BRAND));
|
|
|
requests.add(this.buildBrandNewShelveRequest(query, filter, brandId, RecallConstants.RECALL_SKN_COUNT_PER_BRAND_NEW));
|
|
|
}
|
|
|
// 3) 新降价
|
|
|
for (Integer brandId : brandIds) {
|
|
|
requests.add(this.buildBrandNewReducePriceRequest(query, filter, brandId,RecallConstants.RECALL_SKN_COUNT_PER_BRAND));
|
|
|
requests.add(this.buildBrandNewReducePriceRequest(query, filter, brandId,RecallConstants.RECALL_SKN_COUNT_PER_BRAND_REDUCE_PRICE));
|
|
|
}
|
|
|
// 4) 新开促销
|
|
|
for (Integer brandId : brandIds) {
|
|
|
requests.add(this.buildBrandNewPromotionRequest(query, filter, brandId, RecallConstants.RECALL_SKN_COUNT_PER_BRAND));
|
|
|
requests.add(this.buildBrandNewPromotionRequest(query, filter, brandId, RecallConstants.RECALL_SKN_COUNT_PER_BRAND_PROMOTION));
|
|
|
}
|
|
|
return requests;
|
|
|
}
|
...
|
...
|
|