Thank you for your feedback.
Form temporarily unavailable. Please try again or contact to submit your comments.

Service Portal search

Log in to subscribe to topics and get notified when content changes.

Service Portal search

Service Portal displays search data within a widget on the search page. To make data searchable from Service Portal, create a search source that fetches data from a single table within your ServiceNow instance, from multiple ServiceNow tables, or from an external site. Configure search options or build custom search components.

Search sources

A search source is a record that describes the behavior and source of searchable data. A search source defines:
  • Where to retrieve search data from.
  • Whether search suggestions can populate the search field based on user input.
  • How a search entry displays in the search result page.

Search sources have simple and advanced configurations.

Define a table within your ServiceNow instance as a source of searchable data. To learn more, see Define a search source.

Define a data fetch script to return data. A data fetch script executes on the server and returns a result array to the search widget. This method is more complex, but offers complete power over how a search executes. You are not limited to querying single tables within ServiceNow and can define a script that fetches data from multiple tables, or from anywhere on the web. To learn more, review the Tutorial: set up an external knowledge base search source.

Note: Search facets may not behave as expected if integrated into an advanced search source that queries data from a non-ServiceNow site.

Text index groups

A text index group defines how users see search results. For example, combine search results from several sources, or set the weight of certain fields.Text index groups are a Now Platform feature. To learn more, see Configure multiple tables for indexing and searching.

Associate a portal with a text index group to create common search rules and to combine search results from all search sources in the group. If you have a custom search source or portal, consider whether you want to use the base system portal_index_group text index group, or create your own text index group. The base system text index group includes the Catalog items, Knowledge, and Social Q&A Questions tables. When a user searches for an item in Service Portal, they see combined results from these tables. To add an index group to a portal, see Add a text index group to a portal.

Note: Text index groups do not support external search sources.

Typeahead settings

Typeahead returns search results as a user types in the search field. You can configure typeahead settings, or disable the feature entirely, within the search source record.

Define an icon to display beside typeahead results and the target page to display typeahead selections.
Define a template for the typeahead result. See Create an advanced typeahead template.

Search facets

Enable your end users to filter search results for a more meaningful result set. Facets can return results based on:

  • Fields in a table such as Active or Author.
  • Query conditions such as [Updated][After][Last week].
Note: Only set search facets for indexed fields. Fields that are not indexed may take longer to return results and are not optimized for a fast search experience. Learn more: Enable text indexing for a table.

Search facets render in the Faceted Search widget on the sp_search page. In new instances, search facets are enabled by default. If upgrading from a previous release, enable search facets by activating a record in the Page Route Maps [sp_page_route_map] table. See Enable search facets.

Enable end users to refine search results for a simple search source. You can create facets for a table search source that return results based on field values or query conditions. See Add facets to a simple search source.

Define facets for advanced search sources using the Facet generation script on the search source record. Use facet APIs to create facets and assign ServiceNow facet items or mapped queries to the facet.

SPScriptedFacetService - Scoped Creates a single or multi choice facet.
SPScriptedFacet - Scoped Defines facet items, filters, or mapped queries for the facet.

Search analytics and suggestions

Generate relevant search suggestions for your users and monitor search analytics to understand what your users are searching for and whether they're finding what they need. Search analytics and suggestions is a Now Platform feature. For more information, see Search analytics and suggestions.

Populate suggestion data on upgrade
If you are upgrading from a previous release, run a script to populate search suggestions with data from a platform search table to provide search suggestions to your users. For more information, see Populate search suggestions in Service Portal.
Generate suggestions from custom widgets
By default, the Search Events [sys_search_event] and Search Source Events [sys_search_source_event] tables collect search data from base system search widgets. To generate search analytics from custom Service Portal search widgets, use the GlideSPSearchAnalytics API. For more information, see GlideSPSearchAnalytics.
Use suggestions instead of typeahead search
Search suggestions replaces typeahead search in Service Portal. Update the glide.service_portal.search_as_you_type_behavior system property to change this behavior. For more information, see Enable and disable search suggestions. Service Portal search widgets automatically use whichever feature you enable.

Search configurations

When you create a simple search source, Service Portal uses the search engine settings configured on your instance. To learn more, see Search administration.

Performance recommendations

To avoid performance degradation and to ensure a fast search experience for end users, follow these recommendations.

  • Limit search sources when possible to perform only the necessary query. For example, if a search only needs to return active incidents, add a condition to the search source set to [Active] [is] [true]. A search that queries only active incidents is faster than a search that queries all records in the incident table.
  • Create facet items and mapped queries with no more than 30 filter items. To verify, test each search source with a variety of keywords as a user with low permissions.
Note: Service Portal search results display as text only. HTML tags, images, and formatting do not display in search results.