Zing search in Service Portal
Summarize
Summary of Zing Search in Service Portal
Zing search in Service Portal leverages ServiceNow's native Zing text indexing and search engine to enable fast, efficient searching of record data across tables within your instance. It supports creating configurable search sources that pull data from single or multiple ServiceNow tables, or even external sites, allowing your users to find relevant content directly within the Service Portal.
Show less
Search Sources
Search sources define the data retrieval method and display behavior for searchable content. There are two types:
- Simple search sources: Query a single ServiceNow table. They use default search engine settings and are easier to configure.
- Advanced search sources: Use server-side data fetch scripts to query multiple tables or external data sources, offering full control over search execution. However, search facets may not function as expected with external sources.
Text Index Groups
Text index groups control how search results are combined and weighted across multiple search sources. Associating a portal with a text index group enables unified search rules and consolidated results from all grouped sources. The base system includes a default text index group covering Catalog Items and Knowledge tables, which can be extended or customized as needed. Note that text index groups do not support external search sources.
Search Suggestions and Typeahead
Service Portal replaces traditional typeahead with search suggestions, which can be enabled or disabled via the glide.serviceportal.searchasyoutypebehavior system property. Search widgets automatically adapt to the enabled behavior, enhancing user experience by offering relevant query completions.
Search Facets
Facets allow users to filter search results based on indexed fields or query conditions, improving result relevance and navigation. Facets are enabled by default in new instances and can be activated in upgrades. They are configurable differently for simple and advanced search sources:
- Simple sources: Facets can be created based on field values or query conditions.
- Advanced sources: Facets are defined via scripts and APIs to specify filters or mapped queries.
Facets appear in the Faceted Search widget on the spsearch page, and can also be disabled per search source via system properties.
Practical Configuration and Usage
- Define search sources: Configure either simple or advanced sources to tailor search data retrieval.
- Enable or disable search facets: Manage facets to refine search results or optimize performance.
- Populate search suggestions: For upgrades, run a script to pre-populate suggestions or allow dynamic population.
- Add text index groups to portals: Control how search results are aggregated and weighted across sources.
- Set default search sources: Use the
glide.serviceportal.defaultsearchsourcesproperty to define defaults. - Configure contextual search: Limit results for specific search widget instances to improve relevance.
This configuration flexibility enables ServiceNow customers to deliver powerful, responsive, and tailored search experiences within their Service Portals, improving user satisfaction and efficiency in locating information.
Service Portal search supports the ServiceNow Zing text indexing and search engine. Zing allows you to index and search record data by table and is created entirely with ServiceNow code and implemented within the relational model.
To make data searchable from Service Portal, you create search sources that fetch data from a single table within your ServiceNow instance, from multiple ServiceNow tables, or from an external site.
Search sources
- 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.
- Simple
- Define a table within your ServiceNow instance as a source of searchable data. To learn more, see Define a search source.
When you create a simple search source, Service Portal uses the search engine settings configured on your instance. To learn more, see Zing text indexing and search engine.
- Advanced
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 ServiceNow AI 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 and Knowledge 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.
Search suggestions and 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 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].
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.
- Simple
- 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.
- Advanced
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.
API Use SPScriptedFacetService - Scoped Creates a single or multi choice facet. SPScriptedFacet - Scoped Defines facet items, filters, or mapped queries for the facet.