|
|
package com.yoho.search.service.base.index;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.search.base.utils.ConvertUtils;
|
|
|
import com.yoho.search.base.utils.ISearchConstants;
|
|
|
import com.yoho.search.base.utils.ProductIndexEsField;
|
|
|
import com.yoho.search.core.es.model.SearchParam;
|
|
|
import com.yoho.search.core.es.model.SearchResult;
|
|
|
import com.yoho.search.models.RecommendPromotionAggVO;
|
|
|
import com.yoho.search.service.base.SearchCommonService;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
...
|
...
|
@@ -14,14 +15,10 @@ import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.yoho.search.base.utils.ConvertUtils;
|
|
|
import com.yoho.search.base.utils.ISearchConstants;
|
|
|
import com.yoho.search.core.es.model.SearchParam;
|
|
|
import com.yoho.search.core.es.model.SearchResult;
|
|
|
import com.yoho.search.service.base.SearchCommonService;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* Created by wangnan on 2017/5/11.
|
|
|
*/
|
...
|
...
|
@@ -58,7 +55,7 @@ public class PromotionIndexBaseService { |
|
|
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
|
|
boolQueryBuilder.must(QueryBuilders.termsQuery(ProductIndexEsField.id, ids));
|
|
|
boolQueryBuilder.must(QueryBuilders.termQuery(ProductIndexEsField.status, 1));
|
|
|
boolQueryBuilder.mustNot(QueryBuilders.termQuery(ProductIndexEsField.MATCHED_PROMOTIONS_ISDEL, "Y"));
|
|
|
boolQueryBuilder.mustNot(QueryBuilders.termQuery(ProductIndexEsField.isDel, "Y"));
|
|
|
|
|
|
searchParam.setFiter(boolQueryBuilder);
|
|
|
searchParam.setSize(ids.size());
|
...
|
...
|
|