FEATURE: Add in:polls filter to search (#19885)

Allows users to filter search results to posts with polls (if the plugin is enabled).
This commit is contained in:
Penar Musaraj
2023-01-18 14:55:20 -05:00
committed by GitHub
parent 60ebbfd7e7
commit 3e197deec9
3 changed files with 55 additions and 0 deletions
@@ -134,6 +134,11 @@ function initializePolls(api) {
id: "discourse-poll",
});
api.cleanupStream(cleanUpPolls);
const siteSettings = api.container.lookup("site-settings:main");
if (siteSettings.poll_enabled) {
api.addSearchSuggestion("in:polls");
}
}
export default {