From 67d5307a8f24ae5c053aa64294acac357cb72213 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 16 Jul 2014 20:46:44 -0400 Subject: [PATCH] small change to tag search --- src/topics/tags.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/topics/tags.js b/src/topics/tags.js index 2103d840b9..5efad30c78 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -140,8 +140,12 @@ module.exports = function(Topics) { } if (plugins.hasListeners('filter:tags.category')) { - plugins.fireHook('filter:tags.category', {tags: [], cid: data.cid}, function(err, data) { - doSearch(err, data ? data.tags : null); + plugins.fireHook('filter:tags.category', {tags: [], cid: data.cid}, function(err, result) { + if (data.query.length === 1) { + callback(err, result.tags); + } else { + doSearch(err, result ? result.tags : null); + } }); } else { db.getSortedSetRevRange('tags:topic:count', 0, -1, doSearch);