From e9fbab0f2667c232ff9d040edd1bf1fca9c8bed5 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Thu, 5 Dec 2013 20:11:05 -0500 Subject: [PATCH] need mongo 2.4+ for text search' --- src/database/mongo.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/database/mongo.js b/src/database/mongo.js index 699c46af6f..9005c86095 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -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); });