molecuel / mongolastic

Mongolastic - Mongoose middleware for elasticsearch integration
MIT License
8 stars 4 forks source link

TypeError: Cannot call method 'checkCreateByModel' of undefined #7

Closed CombatCode closed 10 years ago

CombatCode commented 10 years ago
TypeError: Cannot call method 'checkCreateByModel' of undefined
    at mongolastic.registerModel (/home/combat/.dev/urstyle/node_modules/mongolastic/index.js:406:19)

this line is crashing:

  elastic.indices.checkCreateByModel(model,

console.log of elastic:

{ connection: null, prefix: null }
CombatCode commented 10 years ago

Fixed, mongolastic is not connecting to elastic search automatically . So it will be good to add this note to documentation.

mongolastic.connect('mongolastic', {
    host: 'localhost:9200',
    sniffOnStart: true
}, function(err) {
    if(err) {
        console.log(err);
    } else {
        console.log('Connected to ElasticSearch');
    }
});
DominicBoettger commented 10 years ago

Hi CombatCode,

sorry we were not available during the last days. Good that you were able to solve your problem. I added your information to the Readme. Sorry for the delay.

Best regards Dominic