added indices on search key and id for mongo

This commit is contained in:
barisusakli
2014-09-03 23:43:07 -04:00
parent 3360752c5c
commit f81acd37db
2 changed files with 8 additions and 2 deletions

View File

@@ -105,6 +105,12 @@
}
});
db.collection('search').ensureIndex({key: 1, id: 1}, {background: true}, function(err) {
if(err) {
winston.error('Error creating index ' + err.message);
}
});
if(typeof callback === 'function') {
callback();
}