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

Populate search suggestions in Service Portal

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

Populate search suggestions in Service Portal

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. Alternatively, you can wait until users search for keywords instead of running this script.

Before you begin

Role required: admin

In new instances, the search suggestions are enabled by default. In upgraded instances, you must enable the search suggestions. For more information, see Enable search suggestions.

About this task

The Now Platform collects search data and analytics that generate search suggestions. If you are upgrading from a previous release, the search analytics do not contain any data yet. To immediately provide suggestions to your users, you can populate the search suggestions using data from either the Text Searches [text_search] table or the Service Portal Log Entries [sp_log] table. The Service Portal Log Entries table includes search data from Service Portal only and may take less time to populate search suggestions. The Text Search table includes search data from the entire platform.

Search suggestions improve over time as more people use Service Portal. Search analytics and suggestions is a Now Platform feature. For more information, see Search analytics and suggestions.

Caution: Populating search suggestions can be a resource-intensive task that may take a while to complete. Do not run this script during peak hours. Populating search suggestions is not supported on domain-separated instances.


  1. Navigate to System Definition > Scheduled Jobs.
  2. Open the Populate Suggestions to avoid Cold Start - Portals scheduled job.
  3. Modify the script for your search implementation.
    1. Define which portals the suggestions apply to. By default, the script populates suggestions in the base system service portal, but you can add as many as you want to the array.
      var portals = ["Service Portal"];
    2. Change where the data comes from. By default, the script imports data from the Text Searches [text_search] table, but you can change the source table to the Service Portal Log Entries [sp_log] table. The Service Portal Log Entries only saves records from the last 90 days.
      var searchLogTable = "text_search";
    3. Push data to any custom search sources in your instance. Suggestions are not enabled for external search sources. You must push data to both the search source name and the Sys ID.

      For example, push text searches from the Incident table to your custom Incident search source. For more information about custom search sources, see Define a search source. By default, the system pushes text searches from the Catalog, Knowledge, and Social Q&A Questions tables to the respective search sources.

      Add the following code after line 11 in the script for each of your custom search sources.


      If the search source table does not exist, the system does not push suggestions to that search source.

    4. Save the record.
      Make sure that the script includes the configuration you need. You can only run the script once.
  4. Activate the record and select Execute Now.
    Running this scheduled job populates the Search Events [sys_search_event], Search Source Events [sys_search_source_event], and Search Suggestions [sys_search_suggestion] tables.


Users see suggestions when they start typing in a Service Portal search widget.