From deecf044540692edac627dfb7f4f413938994073 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Wed, 7 Jun 2017 14:21:03 -0400 Subject: [PATCH] add filter:search.filterAndSort --- src/search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/search.js b/src/search.js index 3ed7f4ef35..6fe103015c 100644 --- a/src/search.js +++ b/src/search.js @@ -122,7 +122,10 @@ function filterAndSort(pids, data, callback) { sortPosts(posts, data); - pids = posts.map(function (post) { + plugins.fireHook('filter:search.filterAndSort', { pids: pids, posts: posts, data: data }, next); + }, + function (result, next) { + pids = result.posts.map(function (post) { return post && post.pid; });