Authored by liangyi.chen@yoho.cn

Fix Es Bug

package com.yoho.datasync.consumer.handler.listener.community;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoho.datasync.consumer.common.EventEnum;
import com.yoho.datasync.consumer.common.IndexConstant;
import com.yoho.datasync.consumer.handler.config.ConfigReaderUtil;
... ... @@ -47,7 +47,12 @@ public class UserInfoListener extends AbstractMqListener<UserInfo> {
boolean syncFlag = configReaderUtil.getBoolean("sync.es.flag", false);
if(syncFlag){
//更新用户信息索引到ES 添加到队列中
ESBluk esBluk = new ESBluk(JSON.toJSONString(userInfo),String.valueOf(userInfo.getYohoUid()),
JSONObject userInfoJson = new JSONObject();
userInfoJson.put("nick_name",userInfo.getNickName());
userInfoJson.put("gender",userInfo.getGender());
userInfoJson.put("head_ico",userInfo.getHeadIco());
userInfoJson.put("yoho_uid",userInfo.getYohoUid());
ESBluk esBluk = new ESBluk(userInfoJson.toJSONString(),String.valueOf(userInfo.getYohoUid()),
IndexConstant.INDEX_NAME.GRASS,IndexConstant.INDEX_TYPE.USER_INFO,false);
esUpdateProcess.add(esBluk);
logger.info("add userInfo data to queue for sync to es");
... ...