Closed AntsKnows closed 2 years ago
Unfortunately not with the javascript plugin. You can do this with a golang plugin by implementing the Process
function which basically allows you to do whatever you need with the MongoDB document.
If it doesn't need to be real time then you could consider https://stackoverflow.com/questions/25144034/how-to-copy-some-elasticsearch-data-to-a-new-index.
You may also be able to do something with a processing pipeline in Elasticsearch, but I couldn't find a way to send the doc to 2 indexes with a quick search.
Unfortunately not with the javascript plugin. You can do this with a golang plugin by implementing the
Process
function which basically allows you to do whatever you need with the MongoDB document.If it doesn't need to be real time then you could consider https://stackoverflow.com/questions/25144034/how-to-copy-some-elasticsearch-data-to-a-new-index.
You may also be able to do something with a processing pipeline in Elasticsearch, but I couldn't find a way to send the doc to 2 indexes with a quick search.
@rwynn Thanks for your reply, do help me solve the problem.I have found the sample code in https://github.com/rwynn/monstache/issues/298
Is there any way to trans one doc to two different index in javascript plugin ? Such as: there is a collection db.foo with one doc {"test":"good"} and two index bar1,bar2. The config is like :
Now i'd like to sync the doc to bar2 at the same time, what should i do?