mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-02 22:00:34 +01:00
need mongo 2.4+ for text search'
This commit is contained in:
@@ -69,22 +69,21 @@
|
||||
//
|
||||
|
||||
module.searchIndex = function(key, content, id) {
|
||||
|
||||
// REQUIRES MONGO 2.4
|
||||
db.collection('search').update({key:key, content:content, _id:id}, {upsert:true, w: 1}, function(err, result) {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
module.search = function(key, term, callback) {
|
||||
// REQUIRES MONGO 2.4
|
||||
db.command({text:"search" , search: term }, function(err, result) {
|
||||
callback(err, result)
|
||||
});
|
||||
/*db.runCommand("text", { search: term }, function(err, result) {
|
||||
callback(err, result);
|
||||
});*/
|
||||
}
|
||||
|
||||
module.searchRemove = function(key, id) {
|
||||
// REQUIRES MONGO 2.4
|
||||
db.collection('search').remove({_id:id}, function(err, result) {
|
||||
callback(err, result);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user