|
|
|
@ -404,7 +404,7 @@ var RDB = require('./redis.js'),
|
|
|
|
|
topics: data[0]?data[0]:0,
|
|
|
|
|
posts: data[1]?data[1]:0
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
socket.emit('post.stats', stats);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -412,4 +412,28 @@ var RDB = require('./redis.js'),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Posts.reIndexPids = function(pids, callback) {
|
|
|
|
|
|
|
|
|
|
function reIndex(pid, callback) {
|
|
|
|
|
|
|
|
|
|
Posts.getPostField(pid, 'content', function(content) {
|
|
|
|
|
search.remove(pid, function() {
|
|
|
|
|
|
|
|
|
|
if(content && content.length) {
|
|
|
|
|
search.index(content, pid);
|
|
|
|
|
}
|
|
|
|
|
callback(null);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async.each(pids, reIndex, function(err) {
|
|
|
|
|
if(err) {
|
|
|
|
|
callback(err, null);
|
|
|
|
|
} else {
|
|
|
|
|
callback(null, 'Posts reindexed');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}(exports));
|