Search code examples
mongodbelasticsearchmongoosastic

Bulk indexing is not working for me - mongoosastic


Only 1 batch is being indexed irrespective of the size of the batch or delay size.

teamSchema.plugin(mongoosastic, {
esClient: esClient,
bulk:{
batch: 10
}
});

Indexes only 10 even though there are more than 10 records in mongodb.

Error:

[MongoError: cursor killed or timed out] name: 'MongoError', message: 'cursor killed or timed out'.


Solution

  • The issue was in my model. Needed to add dropdups:true for the unique index.