I want to change the number of results shown in the contextual search

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 09:13 PM
I'm now customizing contextual search to change the number of result shown in the contextual search.
With the default setting, results of contextual search will be shown in threes, and maximum 20 results will be returned.
I've found variables "limit" and "max_search_result_count", but when I change the default value of those variables, only header of the message changes and link list shows in threes, and the max search result won't change as well.
How can I change max search result and result shown by time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 06:20 AM
Hi @Ayaka KAZAMA,
As you have already customized the contextual search--
Need to modify script Header message--
return gs.getMessage("Showing results {0} of {2}", [start.toString(), end.toString(), vaVars.searchResultCount.toString()]);
I hope this helps!
Regards,
Hemant
**Please mark my answer correct or helpful based on the impact**

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 03:22 AM
I didn't mean I wanted to change the header message.
I want to change the results shown default in threes to tens or more. I expected by changing the limit of script variables from 3 to 10 I could manage this, but I couldn't. Do you know how can I achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2023 02:25 PM
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0967215
I don't think this is possible out of the box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 03:31 AM
It's possible with minor configuration and customisations, please follow below my article:
https://www.servicenow.com/community/virtual-agent-nlu-articles/maximizing-relevant-content-display-...
Thanks,
Ratnakar