Authored by wangnan

删除shops索引中关于品牌的信息和相关的代码

... ... @@ -2,7 +2,6 @@ package com.yoho.search.consumer.index.fullbuild;
import com.yoho.search.consumer.index.common.IIndexBuilder;
import com.yoho.search.consumer.service.base.ShopService;
import com.yoho.search.consumer.service.logic.ShopsLogicService;
import com.yoho.search.dal.model.Shops;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
... ... @@ -16,8 +15,6 @@ import java.util.List;
public class ShopsIndexBuilder extends IIndexBuilder {
@Autowired
private ShopService shopService;
@Autowired
private ShopsLogicService shopsLogicService;
@Override
public int getTotalCount() throws Exception {
... ... @@ -26,7 +23,7 @@ public class ShopsIndexBuilder extends IIndexBuilder {
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
return shopsLogicService.getShopsBOs(offset, limit);
return shopService.getshopPageLists(offset, limit);
}
@Override
... ...
package com.yoho.search.consumer.index.fullbuild;
import com.yoho.search.consumer.index.common.IIndexBuilder;
import com.yoho.search.consumer.service.base.TblBrandService;
import com.yoho.search.consumer.service.bo.ShopsBO;
import com.yoho.search.consumer.service.logic.tbl.TblShopsLogicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* Created by wangnan on 2017/1/4.
*/
@Component
public class TblShopsIndexBuilder extends IIndexBuilder {
@Autowired
private TblBrandService tblBrandService;
@Autowired
private TblShopsLogicService tblShopsLogicService;
@Override
public int getTotalCount() throws Exception {
return tblBrandService.selectCount();
}
@Override
public List<?> getPageLists(int offset, int limit) throws Exception {
return tblShopsLogicService.getShopsBOs(offset, limit);
}
@Override
public String getId(Object object) {
return ((ShopsBO) object).getShopsId().toString();
}
}
package com.yoho.search.consumer.index.increment;
import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
import com.yoho.error.event.SearchEvent;
import com.yoho.search.base.utils.ConvertUtils;
import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.index.common.IYohoIndexService;
import com.yoho.search.consumer.service.base.ShopsBrandsService;
import com.yoho.search.consumer.service.bo.ShopsBO;
import com.yoho.search.consumer.service.logic.ShopsLogicService;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.ShopsBrands;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by wangnan on 2016/12/1.
*/
@Component
public class ShopsBrandsMqListener extends AbstractMqListener implements ChannelAwareMessageListener {
private static final Logger logger = LoggerFactory.getLogger(ShopsBrandsMqListener.class);
@Autowired
private IYohoIndexService indexService;
@Autowired
private ShopsBrandsService shopsBrandsService;
@Autowired
private ShopsLogicService shopsLogicService;
@Override
public void onMessage(Message message, Channel channel) throws Exception {
try {
String messageStr = new String(message.getBody(), "UTF-8");
logger.info("[model=ShopsBrandsMqListener][message={}]", messageStr);
// 如果在重建索引等待
this.waitingRebuildingIndex();
JSONObject json = JSONObject.parseObject(messageStr);
String indexName = ISearchConstants.INDEX_NAME_SHOPS;
String idField = ISearchConstants.getKeyField(indexName);
if (ISearchConstants.ACTION_DELETE.equals(json.getString("action"))) {
deleteData(json.getString("data"), indexName, idField);
} else if (ISearchConstants.ACTION_UPDATE.equals(json.getString("action"))) {
updateData(json.getObject("data", Map.class), indexName, idField);
} else {
updateData(json.getObject("data", Map.class), indexName, idField);
}
} catch (Exception e) {
publisher.publishEvent(new SearchEvent(EventReportEnum.SHOPSBRADNSMQLISTENER_ONMESSAGE.getEventName(),
EventReportEnum.SHOPSBRADNSMQLISTENER_ONMESSAGE.getFunctionName(),
EventReportEnum.SHOPSBRADNSMQLISTENER_ONMESSAGE.getMoudleName(), "exception", IgnoreSomeException.filterSomeException(e), null));
Thread.sleep(1000);
throw e;
}
}
@SuppressWarnings({"rawtypes", "unchecked"})
public void updateData(final Map data, final String indexName, final String idField) throws Exception {
long begin = System.currentTimeMillis();
ShopsBrands shopsBrands = new ShopsBrands();
shopsBrands = (ShopsBrands) ConvertUtils.toJavaBean(shopsBrands, data);
if (shopsBrands == null || shopsBrands.getShopsId() == null) {
return;
}
String idValue = shopsBrands.getId().toString();
shopsBrandsService.saveOrUpdate(shopsBrands);
logger.info("[func=updateData][step=saveToDb][indexName={}] [id={}][cost={}ms]", indexName, idValue, (System.currentTimeMillis() - begin));
List<Integer> ids = new ArrayList<>();
ids.add(shopsBrands.getShopsId());
List<ShopsBO> shopBOs = shopsLogicService.getShopsBOs(ids);
if (!CollectionUtils.isEmpty(shopBOs)) {
ShopsBO shopsBO = shopBOs.get(0);
List<ESBluk> results = new ArrayList<ESBluk>();
results.add(new ESBluk(JSONObject.toJSONString(this.beanToMap(shopsBO)), shopsBO.getShopsId().toString(), indexName, indexName, false));
indexService.bulk(results);
}
logger.info("[func=updateData][step=success][indexName={}] [id={}][cost={}ms]", indexName, idValue, (System.currentTimeMillis() - begin));
}
public void deleteData(final String id, final String indexName, final String idField) throws Exception {
if (StringUtils.isBlank(id)) {
return;
}
long begin = System.currentTimeMillis();
ShopsBrands shopsBrands = shopsBrandsService.getById(Integer.valueOf(id));
shopsBrandsService.delete(Integer.valueOf(id));
logger.info("[func=deleteData][step=deleteFromDb][indexName={}] [id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
List<Integer> ids = new ArrayList<>();
ids.add(shopsBrands.getShopsId());
List<ShopsBO> shopBOs = shopsLogicService.getShopsBOs(ids);
if (!CollectionUtils.isEmpty(shopBOs)) {
ShopsBO shopsBO = shopBOs.get(0);
List<ESBluk> results = new ArrayList<ESBluk>();
results.add(new ESBluk(JSONObject.toJSONString(this.beanToMap(shopsBO)), shopsBO.getShopsId().toString(), indexName, indexName, false));
indexService.bulk(results);
}
logger.info("[func=deleteData][step=success][indexName={}][id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
}
private Map<String, Object> beanToMap(ShopsBO shopsBO) {
JSONObject josnoJsonObject = (JSONObject) JSONObject.toJSON(shopsBO);
return josnoJsonObject;
}
}
... ... @@ -8,8 +8,6 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.index.common.IYohoIndexService;
import com.yoho.search.consumer.service.base.ShopService;
import com.yoho.search.consumer.service.bo.ShopsBO;
import com.yoho.search.consumer.service.logic.ShopsLogicService;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.Shops;
... ... @@ -20,7 +18,6 @@ import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
... ... @@ -38,8 +35,6 @@ public class ShopsMqListener extends AbstractMqListener implements ChannelAwareM
private IYohoIndexService indexService;
@Autowired
private ShopService shopService;
@Autowired
private ShopsLogicService shopsLogicService;
@Override
public void onMessage(Message message, Channel channel) throws Exception {
... ... @@ -78,15 +73,9 @@ public class ShopsMqListener extends AbstractMqListener implements ChannelAwareM
String idValue = shops.getShopsId().toString();
shopService.saveOrUpdate(shops);
logger.info("[func=updateData][step=saveToDb][indexName={}] [id={}][cost={}ms]", indexName, idValue, (System.currentTimeMillis() - begin));
List<Integer> ids = new ArrayList<>();
ids.add(shops.getShopsId());
List<ShopsBO> shopBOs = shopsLogicService.getShopsBOs(ids);
if(!CollectionUtils.isEmpty(shopBOs)){
ShopsBO shopsBO = shopBOs.get(0);
List<ESBluk> results = new ArrayList<ESBluk>();
results.add(new ESBluk(JSONObject.toJSONString(this.beanToMap(shopsBO)), shopsBO.getShopsId().toString(), indexName, indexName, false));
indexService.bulk(results);
}
List<ESBluk> results = new ArrayList<ESBluk>();
results.add(new ESBluk(JSONObject.toJSONString(this.beanToMap(shops)), shops.getShopsId().toString(), indexName, indexName, false));
indexService.bulk(results);
logger.info("[func=updateData][step=success][indexName={}] [id={}][cost={}ms]", indexName, idValue, (System.currentTimeMillis() - begin));
}
... ... @@ -103,8 +92,8 @@ public class ShopsMqListener extends AbstractMqListener implements ChannelAwareM
logger.info("[func=deleteData][step=success][indexName={}][id={}][cost={}ms]", indexName, id, (System.currentTimeMillis() - begin));
}
private Map<String, Object> beanToMap(ShopsBO shopsBO) {
JSONObject josnoJsonObject = (JSONObject) JSONObject.toJSON(shopsBO);
private Map<String, Object> beanToMap(Shops shops) {
JSONObject josnoJsonObject = (JSONObject) JSONObject.toJSON(shops);
return josnoJsonObject;
}
}
... ...
... ... @@ -9,13 +9,9 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.index.common.IYohoIndexService;
import com.yoho.search.consumer.service.base.TblBrandService;
import com.yoho.search.consumer.service.bo.ShopsBO;
import com.yoho.search.consumer.service.logic.tbl.TblBrandLogicService;
import com.yoho.search.consumer.service.logic.tbl.TblShopsLogicService;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.TblBrand;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -43,11 +39,7 @@ public class TblBrandMqListener extends AbstractMqListener implements ChannelAwa
@Autowired
private TblBrandService tblBrandService;
@Autowired
private TblShopsLogicService tblShopsLogicService;
@Autowired
private IYohoIndexService indexService;
@Autowired
private TblBrandLogicService tblBrandLogicService;
protected ApplicationEventPublisher publisher;
... ... @@ -91,16 +83,6 @@ public class TblBrandMqListener extends AbstractMqListener implements ChannelAwa
return;
}
tblBrandService.saveOrUpdate(tblBrand);
//修改shop索引
List<Integer> ids = new ArrayList<>();
ids.add(tblBrand.getBrandId());
List<ShopsBO> shopsBOS = tblShopsLogicService.getShopsBOs(ids);
if(CollectionUtils.isNotEmpty(shopsBOS)){
ShopsBO shopsBO = shopsBOS.get(0);
List<ESBluk> results = new ArrayList<ESBluk>();
results.add(new ESBluk(JSONObject.toJSONString(this.beanToMap(shopsBO)), shopsBO.getShopsId().toString(), ISearchConstants.INDEX_NAME_SHOPS, ISearchConstants.INDEX_NAME_SHOPS, false));
indexService.bulk(results);
}
String idValue = data.get(idField).toString();
logger.info("[func=updateData][step=success][tableName=tblBrand][id={}][cost={}ms]", idValue, (System.currentTimeMillis() - begin));
}
... ... @@ -117,9 +99,5 @@ public class TblBrandMqListener extends AbstractMqListener implements ChannelAwa
logger.info("[func=deleteData][step=success][tableName=tblBrand][id={}][cost={}ms]", id, (System.currentTimeMillis() - begin));
}
private Map<String, Object> beanToMap(ShopsBO shopsBO) {
JSONObject josnoJsonObject = (JSONObject) JSONObject.toJSON(shopsBO);
return josnoJsonObject;
}
}
... ...
... ... @@ -71,64 +71,6 @@
"shopIntro": {
"type": "string"
},
"brandName": {
"fields": {
"brandName": {
"type": "string",
"analyzer": "lowercase_standard",
"search_analyzer": "lowercase_standard"
},
"brandName_ansj": {
"type": "string",
"store": false,
"analyzer": "ik_complex",
"search_analyzer": "ik_complex"
},
"brandName_pinyin": {
"type": "string",
"store": false,
"analyzer": "pinyin_analyzer",
"search_analyzer": "standard"
}
},
"type": "multi_field"
},
"brandNameCn": {
"fields": {
"brandNameCn": {
"type": "string",
"analyzer": "lowercase_standard",
"search_analyzer": "lowercase_standard"
},
"brandNameCn_ansj": {
"type": "string",
"store": false,
"analyzer": "ik_complex",
"search_analyzer": "ik_complex"
},
"brandNameCn_pinyin": {
"type": "string",
"store": false,
"analyzer": "pinyin_analyzer",
"search_analyzer": "standard"
}
},
"type": "multi_field"
},
"brandNameEn": {
"type": "string",
"analyzer": "lowercase_standard",
"search_analyzer": "lowercase_standard"
},
"brandDomain": {
"type": "string",
"analyzer": "lowercase_standard",
"search_analyzer": "lowercase_standard"
},
"isGlobal": {
"type": "string",
"index": "not_analyzed"
},
"decoratorTemplateType": {
"type": "integer"
}
... ...
package com.yoho.search.consumer.service.bo;
import com.yoho.search.dal.model.Shops;
/**
* Created by wangnan on 2016/12/.
*/
public class ShopsBO extends Shops {
private String brandName;
private String brandDomain;
private String brandNameCn;
private String brandNameEn;
private String isGlobal = "N";
public String getBrandName() {
return brandName;
}
public void setBrandName(String brandName) {
this.brandName = brandName == null ? null : brandName.trim();
}
public String getBrandDomain() {
return brandDomain;
}
public void setBrandDomain(String brandDomain) {
this.brandDomain = brandDomain == null ? null : brandDomain.trim();
}
public String getBrandNameCn() {
return brandNameCn;
}
public void setBrandNameCn(String brandNameCn) {
this.brandNameCn = brandNameCn;
}
public String getBrandNameEn() {
return brandNameEn;
}
public void setBrandNameEn(String brandNameEn) {
this.brandNameEn = brandNameEn;
}
public String getIsGlobal() {
return isGlobal;
}
public void setIsGlobal(String isGlobal) {
this.isGlobal = isGlobal;
}
}
package com.yoho.search.consumer.service.logic;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yoho.search.consumer.service.bo.ShopsBO;
import com.yoho.search.dal.BrandMapper;
import com.yoho.search.dal.ShopMapper;
import com.yoho.search.dal.ShopsBrandsMapper;
import com.yoho.search.dal.model.Brand;
import com.yoho.search.dal.model.Shops;
import com.yoho.search.dal.model.ShopsBrands;
/**
* Created by wangnan on 2016/12/1. 有货店铺索引
*/
@Component
public class ShopsLogicService {
private final Logger logger = LoggerFactory.getLogger(ShopsLogicService.class);
@Autowired
private ShopMapper shopMapper;
@Autowired
private ShopsBrandsMapper shopsBrandsMapper;
@Autowired
private BrandMapper brandMapper;
/**
* 增量
*/
public List<ShopsBO> getShopsBOs(List<Integer> ids) {
long begin = System.currentTimeMillis();
List<Shops> shops = shopMapper.selectByIds(ids);
List<ShopsBO> shopsBOs = buildShopsBOs(shops);
logger.info("[class=ShopsLogicService][function=getShopsBOs],[size:{}],[cost: {}]", shopsBOs.size(), System.currentTimeMillis() - begin);
return shopsBOs;
}
/**
* 全量
*/
public List<ShopsBO> getShopsBOs(int start, int limit) {
long begin = System.currentTimeMillis();
List<Shops> shops = shopMapper.getPageLists(start, limit);
List<ShopsBO> shopsBOs = buildShopsBOs(shops);
logger.info("[class=ShopsLogicService][function=getShopsBOs],[size:{}],[cost: {}]", shopsBOs.size(), System.currentTimeMillis() - begin);
return shopsBOs;
}
/**
* 生成BO
*/
private List<ShopsBO> buildShopsBOs(List<Shops> shops) {
List<ShopsBO> shopsBOs = new ArrayList<>();
if (shops == null || shops.isEmpty()) {
return new ArrayList<ShopsBO>();
}
List<Brand> brands = brandMapper.getAll();
Map<Integer, Brand> brandMap = brands.stream().collect(Collectors.toMap(Brand::getId, (p) -> p));
Map<Integer, List<ShopsBrands>> shopsBrandsMap = getShopsBrandsMap(shops);
for (Shops shop : shops) {
List<ShopsBrands> sbs = shopsBrandsMap.get(shop.getShopsId());
ShopsBO shopsBO = new ShopsBO();
buildBrandName(sbs, brandMap, shopsBO);
shopsBO.setShopsId(shop.getShopsId());
shopsBO.setShopName(shop.getShopName());
shopsBO.setShopDomain(shop.getShopDomain());
shopsBO.setShopNature(shop.getShopNature());
shopsBO.setShopLogo(shop.getShopLogo());
shopsBO.setWebsiteUrl(shop.getWebsiteUrl());
shopsBO.setOtherUrl(shop.getOtherUrl());
shopsBO.setShopAddress(shop.getShopAddress());
shopsBO.setCreatePid(shop.getCreatePid());
shopsBO.setShopsType(shop.getShopsType());
shopsBO.setOperationStatus(shop.getOperationStatus());
shopsBO.setExamineStatus(shop.getExamineStatus());
shopsBO.setStatus(shop.getStatus());
shopsBO.setCheckStatus(shop.getCheckStatus());
shopsBO.setCreateTime(shop.getCreateTime());
shopsBO.setUpdateTime(shop.getUpdateTime());
shopsBO.setBlkStatus(shop.getBlkStatus());
shopsBO.setDecoratorTemplateType(shop.getDecoratorTemplateType());
shopsBOs.add(shopsBO);
}
return shopsBOs;
}
/**
* 处理品牌名
*/
private void buildBrandName(List<ShopsBrands> sbs, Map<Integer, Brand> brandMap, ShopsBO shopsBO) {
if (!CollectionUtils.isEmpty(sbs)) {
StringBuilder brandName = new StringBuilder();
StringBuilder brandNameCn = new StringBuilder();
StringBuilder brandNameEn = new StringBuilder();
StringBuilder brandDomain = new StringBuilder();
for (ShopsBrands shopsBrand : sbs) {
Brand brand = brandMap.get(shopsBrand.getBrandId());
if (brand != null) {
brandName.append(brand.getBrandName() + ",");
brandNameCn.append(brand.getBrandNameCn() + ",");
brandNameEn.append(brand.getBrandNameEn() + ",");
brandDomain.append(brand.getBrandDomain() + ",");
}
}
shopsBO.setBrandName(brandName.toString());
shopsBO.setBrandNameCn(brandNameCn.toString());
shopsBO.setBrandNameEn(brandNameEn.toString());
shopsBO.setBrandDomain(brandDomain.toString());
}
}
/**
* 构建ShopsBrandsMap
*/
private Map<Integer, List<ShopsBrands>> getShopsBrandsMap(List<Shops> shops) {
List<Integer> shopsIds = shops.stream().parallel().map(Shops::getShopsId).collect(Collectors.toList());
List<ShopsBrands> shopsBrandsList = shopsBrandsMapper.selectByShopIds(shopsIds);
Map<Integer, List<ShopsBrands>> shopsBrandsMap = new HashMap<>();
for (ShopsBrands shopsBrands : shopsBrandsList) {
if (shopsBrandsMap.containsKey(shopsBrands.getShopsId())) {
List<ShopsBrands> sbs = shopsBrandsMap.get(shopsBrands.getShopsId());
sbs.add(shopsBrands);
} else {
List<ShopsBrands> sbs = new ArrayList<>();
sbs.add(shopsBrands);
shopsBrandsMap.put(shopsBrands.getShopsId(), sbs);
}
}
return shopsBrandsMap;
}
}
package com.yoho.search.consumer.service.logic.tbl;
import com.yoho.search.consumer.service.base.TblBrandService;
import com.yoho.search.consumer.service.bo.ShopsBO;
import com.yoho.search.dal.model.TblBrand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/**
* Created by wangnan on 2017/1/4.
* 将全球购的店铺加入到shops索引中,使其可以在有货中被搜索出来
*/
@Component
public class TblShopsLogicService {
@Autowired
private TblImgUrlLogicService tblImgUrlLogicService;
@Autowired
private TblBrandService tblBrandService;
/**
* 增量
*/
public List<ShopsBO> getShopsBOs(List<Integer> ids) {
List<TblBrand> tblBrands = tblBrandService.selectByIds(ids);
return generateShopsBOs(tblBrands);
}
/**
* 全量
*/
public List<ShopsBO> getShopsBOs(int start, int limit) {
List<TblBrand> tblBrands = tblBrandService.selectBrandPageList(start, limit);
return generateShopsBOs(tblBrands);
}
/**
* 生成BO
*/
private List<ShopsBO> generateShopsBOs(List<TblBrand> tblBrands) {
List<ShopsBO> shopsBOs = new ArrayList<>();
for (TblBrand tblBrand : tblBrands) {
ShopsBO shopsBO = new ShopsBO();
shopsBO.setBrandName(tblBrand.getBrandNameEn());
shopsBO.setBrandNameCn(tblBrand.getBrandNameCn());
shopsBO.setBrandNameEn(tblBrand.getBrandNameEn());
shopsBO.setBrandDomain("");
shopsBO.setShopsId(0);
shopsBO.setShopName(tblBrand.getBrandNameEn());
shopsBO.setShopDomain("");
shopsBO.setShopNature(0);
if (tblBrand.getLogo() != null) {
shopsBO.setShopLogo(tblImgUrlLogicService.getTblImageUrl(tblBrand.getLogo(), true));
}
shopsBO.setWebsiteUrl("");
shopsBO.setOtherUrl("");
shopsBO.setShopAddress("");
shopsBO.setCreatePid(0);
shopsBO.setShopsType(1);
shopsBO.setOperationStatus(2);
shopsBO.setExamineStatus(1);
if (tblBrand.getStatus().equals("1")) {
shopsBO.setStatus(0);
}
if (tblBrand.getStatus().equals("2")) {
shopsBO.setStatus(1);
}
shopsBO.setCheckStatus(0);
shopsBO.setCreateTime(tblBrand.getCreateTime());
shopsBO.setUpdateTime(tblBrand.getUpdateTime());
shopsBO.setBlkStatus(0);
shopsBO.setIsGlobal("Y");
shopsBOs.add(shopsBO);
}
return shopsBOs;
}
}
... ... @@ -182,7 +182,7 @@
<property key="refresh_interval" value="1s"/>
<property key="translog.flush_threshold_ops" value="5000"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ShopsIndexBuilder,com.yoho.search.consumer.index.fullbuild.TblShopsIndexBuilder</builderClass>
<builderClass>com.yoho.search.consumer.index.fullbuild.ShopsIndexBuilder</builderClass>
<mappingFile>esmapping/shops.json</mappingFile>
</index>
... ...
... ... @@ -159,7 +159,7 @@
<property key="refresh_interval" value="${search.index.refresh_interval}"/>
<property key="translog.flush_threshold_ops" value="${search.index.translog.flush_threshold_ops}"/>
</properties>
<builderClass>com.yoho.search.consumer.index.fullbuild.ShopsIndexBuilder,com.yoho.search.consumer.index.fullbuild.TblShopsIndexBuilder</builderClass>
<builderClass>com.yoho.search.consumer.index.fullbuild.ShopsIndexBuilder,com</builderClass>
<mappingFile>esmapping/shops.json</mappingFile>
</index>
... ...