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

Ayaka KAZAMA
Giga Guru

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.

AyakaKAZAMA_0-1678338343493.png

 

 

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.

AyakaKAZAMA_2-1678338750797.png

AyakaKAZAMA_3-1678338759149.png

AyakaKAZAMA_1-1678338698266.png

How can I change max search result and result shown by time? 

4 REPLIES 4

Hemant Goldar
Mega Sage
Mega Sage

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()]);
 

 

HemantGoldar_1-1678371460949.png

 

I hope this helps!

 

Regards,

Hemant 

**Please mark my answer correct or helpful based on the impact**

 

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?

Cau Thoong
Tera Contributor

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0967215

 

I don't think this is possible out of the box. 

Ratnakar7
Mega Sage
Mega Sage

@Ayaka KAZAMA 

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