Al agregar el complemento a su JobSchema
modelo, debe pasar un segundo parámetro con cómo conectarse a Elasticsearch:
JobSchema.plugin(mongoosastic, {
hosts: [
'localhost:9200'
]
});
También puede reutilizar un objeto de cliente de Elasticsearch si tiene uno listo.
var esClient = new elasticsearch.Client({host: 'localhost:9200'});
JobSchema.plugin(mongoosastic, {
esClient: esClient
})