How do I get a count of the search results for each search source in the service portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2017 01:15 PM
Hello,
I'm trying to get a count of the search results for each search source in the Service Portal. I can get placement of the badge, but I'm at a loss as to how to get a count. I've been through the code on the search page and within the search navigation widget and just can't figure out how to get the count of the results. I want it to look something like the attached screenshot. We are currently using Jakarta.
- Labels:
-
User Experience and Design

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2017 05:25 AM
In the related list of your Service Portal configuration, you'll see your search sources listed.
Click into a search source (eg. Knowledge) to see the Data fetch script for that search source. In that script, you'll see that there's a line which logs the count of search results.
You can look up the data in your Service Portal Log Entries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2018 09:32 AM
Unfortunately this won't work for all of the categories to get a count of search results ahead of time. Each Search source runs individually when you click on the category, so I'd only get the row count when I click the category. I need the row counts to be visible before the user clicks on them. The other idea I had is to put code in the Search Navigation widget to execute the search for each category, however depending on how many results are returned it seems like it could take 5 minutes to iterate through each search source which the customer would not be appreciative of.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2020 08:58 AM
Hello daimeonpilcher
can you please share the solution on how did you do this ? I have the same requirement to show the count of each search source result.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2023 01:40 PM
Sadly haven't had time to do that yet. We're considering switching to the Employee Service Center at this point, but I think we'll have the same issue.