使用express JS将/alm / reindex mongodb迁移到elasticsearch

时间:2017-01-09 10:55:35

标签: node.js mongodb express elasticsearch

尝试使用以下mongo-elasticsearch模块将mongodb迁移到elasticsearch。

var mongo-elasticsearch = require('mongo-elasticsearch');
var t = new mongo-elasticsearch.Transfer({
  esOpts: {
    host: 'localhost:9200',
    log: 'trace'
  },
  esTargetType: 'tweet',
  esTargetIndex: 'twitter',
  mongoUri: 'mongodb://abc123:def456@myhost.com:27747/dbname',
  mongoSourceCollection: 'tweets'
});

t.start().then(function(results) {
  process.exit();
});

我使用reboundodm模块索引文档。建议我,如何重新索引文档。

0 个答案:

没有答案