Recent searches
No recent searches
How to exclude Community posts from Guide search results?
Answered
Posted May 09, 2022
Hello,
We are using the Copenhagen theme with no customizations. When I am in our Guide knowledge base and search for a term, it retrieves both Community posts and Guide articles. While I can fairly easily filter my results to just see articles, many of our users are forgetting this step and feel like the Community posts are junking up their search results.
tldr; How can I exclude Community posts from appearing in our Help Center search results?
Thanks in advance!
0
9
9 comments
Ifra Saqlain
Hey Beth Borghi,
In the latest Copenhagen version, there is a filter in the sidebar and users can use it to exclude only posts on Help Center.
Hope it helps you :)
Thanks
0
Beth_Borghi
Thanks for the reply, Ifra! I'm aware of this, and trying to remind/train users to filter as well - however, since we changed to the Copenhagen theme recently, they're not in the habit yet and a bit unhappy about this. ;) Was hoping there was a way to limit it altogether - thanks!
0
Ifra Saqlain
Hey Beth Borghi, use the below code for your search results template.
0
Beth_Borghi
Hi Ifra Saqlain, thank you for the follow up! I used the above code and it limited the knowledge base articles and only showed the Community posts - I actually want it to do the opposite, and only show KB articles and no Community posts. Is that possible? Thank you!
0
Ifra Saqlain
Hi Beth Borghi,
You can hide community post via custom JS on search results to show only KB articles.
I). Add the template name to search results page.
II). Now, copy and paste the below code to the your script.js file.
Make sure, document_head.hbs file has jQuery Lib:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
Hope you will get your solution :)
Thanks
0
Ifra Saqlain
Update:
0
MC Guenette
Hey Ifra Saqlain
Sorry to bother you, but I feel like you're the closest person I have found for a potential solution. So I'll ask here and if you're able to help I will post it in another thread to help others!
We're looking to hide articles (Categories) from search. Reason is, we're sending only direct links for a couple of categories. With that, I need to be able to hide articles/categories from the search form.
I have tried a couple of things, but no luck.
Hope you're able to help, we do use labels. ie. sc_apps is one of them, I also used CSS to hide categories via ID's everywhere else.
Thank you sooooo much in advance or anyone else possibly jumping in here.
2
Ryan Frye
Hello,
I got this mostly working, but the pagination is off. For us, when executing a search it shows 6 results on the first page, then 4 on the second page, and 11 on the third page, etc. Is there a way to make it so each page shows 25 results for example?
Thanks!
0
Greg Katechis
Hi Ryan! Due to the nature of the provided solution, there really wouldn't be a way to get the results you're looking for. That's because we are returning the number of results and the script simply hiding the results from the community. Short of a product solution that changes the underlying search algorithm, there would not be a way to get the same experience with the hidden results as you have with all of the contend being visible.
The best place to get that feedback is in our feedback forum for Guide. I checked through the most popular posts in there and I was surprised that I didn't see this feedback already captured, despite it being a pretty reasonable request. Just take a look at the posts that explain the best way to get traction on your feedback and hopefully one of our product managers will be able to provide some insight for you!
-1