---
sourceDocument: Xanadu ServiceNow AI Platform Administration
sourceDocumentLink: https://www.servicenow.com/docs/r/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Reindex a table without impacting text search results

# Reindex a table without impacting text search results {#ariaid-title1}

* Release version: Xanadu
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Rebuild text search indexes without adversely impacting search results. You can continue to perform text searches on a table while the index regeneration takes place.

## Before you begin

The table that you want to rebuild the index for must already be configured for indexing and searching. For details on this configuration process, see [Configure a table for indexing and searching](https://www.servicenow.com/docs/ikx52T2SvdSyrAWcJbB0lA#configure-single-table-for-indexing "Enable Zing text indexing for a table to allow users to search its records for string values. Configure the table's text indexing attributes, stop words, and synonym dictionaries to control search behavior.").  
Role required: admin  
Note:  
If the glide.script_processor.admin system property's value has been changed from the default value, you need the role specified by that property value. For details on this property value and its effects, see [Restrict access to background script \[Updated in Security Center 1.3 and 2.0\]](https://www.servicenow.com/docs/access?context=sc-restrict-access-to-background-script&version=xanadu&pubname=xanadu-platform-security&ft:locale=en-US).

## About this task

This reindexing method doesn't purge the entire text search index before the rebuild takes place. It rebuilds the text search table index one record at a time, and reindexes the target table hierarchy only. For example, if you
select the sc_cat_item table, only the sc_cat_item table is reindexed.

## Procedure

1. Navigate to AllSystem DefinitionScripts - Background.  
   Note:  
   If the glide.script_processor.admin system property's value is set to security_admin, you must elevate to that privileged role to access this module. For more information on elevating privileges, see [Elevated privilege roles](https://www.servicenow.com/docs/access?context=c_ElevatedPrivilege&version=xanadu&pubname=xanadu-platform-security&ft:locale=en-US).
2. In the Run script (JavaScript executed on server) text field, enter the following background script, being sure to enclose both arguments in quotes as shown:  

       new GlideTextIndexEvent ( ).indexUpdate('TABLE_NAME', 'EMAIL_ADDRESS');

   Where:
   * `TABLE_NAME` is the name of the table you want to reindex.  
     Note:  
     Only the specified table and its child tables are reindexed.
   * `EMAIL_ADDRESS` is the address to which an email notification should be sent when the table reindex completes. Type <kbd class="ph userinput">null</kbd> for no email notification.
   {#real-time-reindexing__ul_xfp_5j2_d2b}  
   For example, to regenerate the kb_knowledge table text search index, and specify that no email notification is required after the rebuild completes, create the following background script:

       new GlideTextIndexEvent ( ).indexUpdate('kb_knowledge', 'null');

   The script creates an event that the index handler processes, so the script completes without blocking on completion of the reindexing job.
3. Select Run script.
{#real-time-reindexing__steps_fqz_yq1_xdb}

## Result

The system reindexes the text search for the specified table. For large tables, such as sys_metadata, reindexing can take a couple of hours, but you can still perform text searches on the table while the script is running.

*[\>]: and then


