Product documentation Docs
    • English
    • Deutsch
    • 日本語
    • 한국어
    • Français
  • More Sites
    • Now Community
    • Developer Site
    • Knowledge Base
    • Product Information
    • ServiceNow.com
    • Training
    • Customer Success Center
    • ServiceNow Support Videos
  • Log in

Product documentation

  • Home
How search works:
  • Punctuation and capital letters are ignored
  • Special characters like underscores (_) are removed
  • Known synonyms are applied
  • The most relevant topics (based on weighting and matching to search terms) are listed first in search results
Topics are ranked in search results by how closely they match your search terms
  • A match on the entire phrase you typed
  • A match on part of the phrase you typed
  • A match on ALL of the terms in the phrase you typed
  • A match on ANY of the terms in the phrase you typed

Note: Matches in titles are always highly ranked.

  • Release version
    Table of Contents
    • Now Platform capabilities
Table of Contents
Choose your release version
    Home New York Now Platform Capabilities Now Platform capabilities Service Portal Service Portal search Populate search suggestions in Service Portal

    Populate search suggestions in Service Portal

    • Save as PDF Selected topic Topic & subtopics All topics in contents
    • Unsubscribe Log in to subscribe to topics and get notified when content changes.
    • Share this page

    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.

    Procedure

    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.

        searchSources.push("<search-source-table-name>");
        searchSourceIds.push("<search-source-sys-id>");

        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.

    Result

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

    Tags:

    Feedback
    On this page

    Previous topic

    Next topic

    • Contact Us
    • Careers
    • Terms of Use
    • Privacy Statement
    • Sitemap
    • © ServiceNow. All rights reserved.

    Release version
    Choose your release version

      Populate search suggestions in Service Portal

      • Save as PDF Selected topic Topic & subtopics All topics in contents
      • Unsubscribe Log in to subscribe to topics and get notified when content changes.
      • Share this page

      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.

      Procedure

      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.

          searchSources.push("<search-source-table-name>");
          searchSourceIds.push("<search-source-sys-id>");

          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.

      Result

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

      Tags:

      Feedback

          Share this page

          Got it! Feel free to add a comment
          To share your product suggestions, visit the Idea Portal.
          Please let us know how to improve this content

          Check any that apply

          To share your product suggestions, visit the Idea Portal.
          Confirm

          We were unable to find "Coaching" in Jakarta. Would you like to search instead?

          No Yes
          • Contact Us
          • Careers
          • Terms of Use
          • Privacy Statement
          • Sitemap
          • © ServiceNow. All rights reserved.

          Subscribe Subscribed Unsubscribe Last updated: Tags: January February March April May June July August September October November December No Results Found Versions Search preferences successfully updated My release version successfully updated My release version successfully deleted An error has occurred. Please try again later. You have been unsubscribed from all topics. You are now subscribed to and will receive notifications if any changes are made to this page. You have been unsubscribed from this content Thank you for your feedback. Form temporarily unavailable. Please try again or contact  docfeedback@servicenow.com  to submit your comments. The topic you requested does not exist in the release. You were redirected to a related topic instead. The available release versions for this topic are listed There is no specific version for this documentation. Explore products Click to go to the page. Release notes and upgrades Click to open the dropdown menu. Delete Remove No selected version Reset This field is required You are already subscribed to this topic Attach screenshot The file you uploaded exceeds the allowed file size of 20MB. Please try again with a smaller file. Please complete the reCAPTCHA step to attach a screenshot
          Log in to personalize your search results and subscribe to topics
          No, thanks Login