Inserting large amounts of data to Mongoose & ElasticSearch via Mongoosastic

杀马特。学长 韩版系。学妹 提交于 2019-12-13 20:21:38

问题


I am following these instructions: https://www.compose.com/articles/mongoosastic-the-power-of-mongodb-and-elasticsearch-together/

I have a TSV file (17MB) that I am iterating through. I am watching my Indexed results with the following code:

Entry.on('es-indexed',(e,r)=>{
      console.log(`Indexed Result: ${r}
        Indexed Error: ${e}`);
    })

Some of my data is getting indexed properly, but I get many error messages too:

Indexed Result: undefined
        Indexed Error: Error: Request Timeout after 30000ms

Here is my model.js file

const ChebiName = new mySchema({
  name: {
    type: String,
    required: true,
    es_indexed: true
  },

  id: {
    type: Number,
    required: true
  }
});

ChebiName.plugin(mongoosastic);
module.exports = mongoose.model('ChebiName',ChebiName);

来源:https://stackoverflow.com/questions/45155361/inserting-large-amounts-of-data-to-mongoose-elasticsearch-via-mongoosastic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!