How do I limit the results on the Homepage search on service portal?

thomasbraden
Giga Contributor

How can I limit the results in the homepage search to not show everything? Limit it to 10 or so?

find_real_file.png

3 REPLIES 3

Narendra Kota
Mega Sage

Clone the Typeahead Search widget, you can set the search limit in server script line 18.

 

find_real_file.png

Harsh Vardhan
Giga Patron

Predictive search feature that shows words as users type.

Typeahead Search widget Typeahead Search widget
Typeahead search instance options Instance options for typeahead search including title, limit, and search sources
Instance option fields
FieldDescription
TitleThe name or words that appear in the search field before a user starts typing. For example, search or what are you looking for
ColorWhether the search button beside the search field is filled in or not
GlyphThe icon that appears in the search field beside the widget. The search icon is the default. To use a different icon, type the name of the icon in the field, for examplesearch-plus. For a list of icons to choose from, open the instance options for the Icon Link widget.
SizeDetermines the font size and height of the widget. Choose from xs, sm, md, and lg.
LimitThe number of typeahead search entries you want to display. The default number is 15.
Contextual Search SourcesLimit the results available in the typeahead search by only configuring specific search sources. For example, users searching in the Service Catalog only see results for the Service Catalog when that search sources is configure. For more information on contextual search, see Configure Search Sources available on a page

User164731
Kilo Expert

You can set a limit without creating a new widget.

 

Go to the Option schema of that instance and then set your options threre.

 

As example, you can use "{limit:10,title: 'How can we help?', size: 'lg', color: 'default'}"