This commit is contained in:
Julian Lam
2014-02-19 21:06:30 -05:00
parent fdd2dc322b
commit 42d33f8338
6 changed files with 22 additions and 83 deletions

View File

@@ -87,8 +87,6 @@ var db = require('./database'),
plugins.fireHook('action:post.save', postData);
db.searchIndex('post', content, postData.pid);
next(null, postData);
});
}
@@ -447,28 +445,6 @@ var db = require('./database'),
}
}
Posts.reIndexPids = function(pids, callback) {
function reIndex(pid, next) {
Posts.getPostField(pid, 'content', function(err, content) {
if(err) {
return next(err);
}
db.searchRemove('post', pid, function() {
if (content && content.length) {
db.searchIndex('post', content, pid);
}
next();
});
});
}
async.each(pids, reIndex, callback);
}
// this function should really be called User.getFavouritePosts
Posts.getFavourites = function(uid, start, end, callback) {
db.getSortedSetRevRange('uid:' + uid + ':favourites', start, end, function(err, pids) {