Zing search in Service Portal

  • Release version: Yokohama
  • Updated January 30, 2025
  • 3 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Zing search in Service Portal

    Service Portal search leverages the ServiceNow Zing text indexing and search engine, enabling efficient indexing and searching of record data by table within your ServiceNow instance. Zing is a fully ServiceNow-coded solution that operates within the relational database model. By creating search sources, you can make data searchable from the Service Portal, sourcing data from single or multiple ServiceNow tables or even external sites.

    Show full answer Show less

    Search Sources

    A search source defines where and how searchable data is retrieved and presented in Service Portal search results. There are two main types:

    • Simple search sources: These use a single ServiceNow table as the data source and rely on your instance’s default Zing search engine settings. They are straightforward to configure and ideal for typical use cases.
    • Advanced search sources: These use server-side data fetch scripts that can query multiple tables or external data sources, providing full control over search execution. This flexibility allows integration of diverse data but may require more complex setup.

    Text Index Groups

    Text index groups control how search results appear by combining results from multiple search sources and adjusting the importance (weight) of certain fields. They are an AI Platform feature that allows you to associate a portal with a unified set of search rules and sources, providing a consolidated search experience. The base system includes a default text index group covering Catalog items and Knowledge tables, which can be used or customized for your portals.

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

    Search Suggestions and Typeahead Search

    Service Portal search supports search suggestions as a replacement for traditional typeahead search. You can configure this behavior through the glide.serviceportal.searchasyoutypebehavior system property. Search widgets automatically use whichever feature you enable, enhancing user experience by providing relevant suggestions during input.

    Search Facets

    Facets enable end users to filter search results effectively for more meaningful outcomes. Facets can be based on indexed fields (such as status or author) or query conditions. They appear in the Faceted Search widget on the spsearch page and are enabled by default in new instances. When upgrading, facets must be enabled by activating a record in the Page Route Maps [sppageroutemap] table.

    • Simple facets: Applied to simple search sources, allowing filtering based on field values or conditions.
    • Advanced facets: Created via facet generation scripts on advanced search sources, using APIs like SPScriptedFacetService and SPScriptedFacet to define complex filtering logic.

    You can also disable facets for specific search sources through a system property if needed.

    Additional Configuration and Best Practices

    • Populating Search Suggestions: When upgrading from previous releases, you may run a script to pre-populate search suggestions for better user experience, or alternatively rely on dynamic keyword entry.
    • Default Search Sources: Use the glide.serviceportal.defaultsearchsources system property to set which search sources are used by default in your portal.
    • Contextual Search: Limit search results on a per-widget basis by configuring which search sources are available, enhancing relevance and performance.
    • Enabling Facets on Upgrades: If upgrading, ensure facets are enabled by activating the correct records in the Page Route Maps table to leverage filtering capabilities.

    Benefits for ServiceNow Customers

    By configuring Zing search in Service Portal, customers can deliver a powerful, flexible, and user-friendly search experience. This includes quick access to relevant records, the ability to combine multiple data sources, and enhanced filtering with facets, all improving user satisfaction and efficiency in finding information. Advanced options allow integration of external data and customized ranking of search results, supporting diverse enterprise needs.

    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

    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.

    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.

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

    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].
    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: Configure a table for indexing and searching.

    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.