Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Regenerate text index for a single record before scheduling text index regeneration on huge tables like sys_metadata and cmdb - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Regenerate text index for a single record before scheduling text index regeneration on huge tables like sys_metadata and cmdb
KB0755324

Regenerate text index for a single record before scheduling text index regeneration on huge tables like sys_metadata and cmdb


2700 Views Last updated : Oct 5, 2022 public Copy Permalink
KB Summary by Now Assist

Issue

For the latest information, see https://docs.servicenow.com/csh?topicname=regenerate-text-index-one-record.html&version=latest.

Generally, if there is an issue with 'keyword' search [or] 'global' search for some specific search terms, it is recommended to schedule text index regeneration on that table. However, regenerating text index on tables that contain huge data (like 'cmdb' and 'sys_metadata') takes a long time for the Indexing process to be completed. Also, there are chances that this may not solve the text search issue if text indexing is not the actual cause of the issue.

In such cases, it is advised that customers regenerate text index for a single record on the affected table rather than regenerating text index for the whole table.

Resolution

  • Identify the 'table' where keyword search is not working as expected.
  • Identify the 'search term' is present on at least one columns in a record of this table.
  • Identify the 'sys_id' of the record which is not coming in search results.
  • Execute the below script in Scripts - Background
var gr = new GlideRecord('<table>');
gr.get('<sys_id>');
gs.eventQueue("text_index", gr, '[<table>]','update','text_index');

NOTE: In the above script. replace <table> with the table name, <sys_id> with the sys_id of the record whose text index needs to be regenerated

Related Links

The above script regenerates text index only for a specific record. If the search results are successful i.e., if the search term returns the record correctly, you can schedule text index regeneration on the entire table. 

Click here to know more about scheduling text index regeneration on a table.


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.