自动同步问题
Opened this issue · 2 comments
glacierck commented
服务启动时的全量同步有调用e_pipeline,但运行期间mongo数据修改后仅仅是同步了指定的m_collectionname,没有执行e_pipeline。
PS。我在自定义e_pipeline里对m_collectionname里的指定属性做了多个拷贝并正则替换成新文档,然而在自动同步过程中这些字段都没被更新
bulkDataAndPip 里的日志:
--启动时的bulk
[
{
"index":{
"_index":"corpus",
"_type":"contents",
"_id":"ImQs6IdHp"
}
},
{
"title":"doc2019-03-24-2",
"comments":"11111"
}
]
--更新时的bulk
[
{
"update":{
"_index":"corpus",
"_type":"contents",
"_id":"ImQs6IdHp"
}
},
{
"doc":{
"title":"doc2019-03-24-2",
"comments":"22222"
}
}
]
glacierck commented
解决方案。修改getUpdateMasterDocBulk :
return new Promise(function (resolve, reject) {
var bulk = [];
var item = {};
item.doc = opDoc;
bulk.push({
index: {
_index: watcher.Content.elasticsearch.e_index,
_type: watcher.Content.elasticsearch.e_type,
_id: id
}
}, opDoc);
return resolve(bulk);
});
zhr85210078 commented