index topic titles too

This commit is contained in:
Baris Usakli
2013-08-08 11:40:31 -04:00
parent 7251af56e3
commit 0bd56196cf
7 changed files with 87 additions and 30 deletions

View File

@@ -10,7 +10,7 @@ var RDB = require('./redis.js'),
async = require('async'),
plugins = require('./plugins'),
reds = require('reds'),
search = reds.createSearch('nodebbsearch');
postSearch = reds.createSearch('nodebbpostsearch');
(function(Posts) {
@@ -337,7 +337,7 @@ var RDB = require('./redis.js'),
plugins.fireHook('action:save_post_content', [pid, content]);
search.index(content, pid);
postSearch.index(content, pid);
});
});
} else {
@@ -417,10 +417,10 @@ var RDB = require('./redis.js'),
function reIndex(pid, callback) {
Posts.getPostField(pid, 'content', function(content) {
search.remove(pid, function() {
postSearch.remove(pid, function() {
if(content && content.length) {
search.index(content, pid);
postSearch.index(content, pid);
}
callback(null);
});