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

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Regenerate the text index for a single record

# Regenerate the text index for a single record {#ariaid-title1}

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

Update the text search index for a single record. Use this approach to quickly verify whether text indexing is the cause of a search issue without rebuilding the full text index for an entire table.

## Before you begin

Identify the following:

* A search term that doesn't return the expected results
* A record containing the identified search term that isn't returned when searching for the term
* The table that includes the identified record
{#regenerate-text-index-one-record__ul_vxf_4rd_ntb}

The identified table 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/Bi5qqYdPJnRNHN8SPotobw#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=yokohama&pubname=yokohama-platform-security&ft:locale=en-US).

## About this task

This reindexing method rebuilds the text search index for a single record. It takes less time than rebuilding the text index for all records in a table.

You can use this method to quickly determine whether text indexing is the cause of a search issue. Doing so avoids the delay associated with rebuilding the entire table's text search index.

## Procedure

1. Copy the sys_id for the identified record by selecting Copy sys_id from its context menu. {#regenerate-text-index-one-record__copy-sys-id-step}
{#regenerate-text-index-one-record__copy-sys-id-step}
2. 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=yokohama&pubname=yokohama-platform-security&ft:locale=en-US).
3. In the Run script (JavaScript executed on server) text field, enter the following script, replacing `TABLE_NAME` with the name of the table containing the identified record and `SYS_ID` with the record's sys_id that you copied in step [1](https://www.servicenow.com/docs/B3qOau3OTOmmZC_jYDBq9w#regenerate-text-index-one-record__copy-sys-id-step):  

       var gr = new GlideRecord('TABLE_NAME');
       gr.get('SYS_ID');
       gs.eventQueue("text_index", gr, '[TABLE_NAME]','update','text_index');

4. Select Run script.  
   The script creates a text_index update event for the specified table in the text_index queue.
5. Navigate to AllSystem PolicyEventsEvent Log and wait for the new text_index update event's state to change to processed.  
   To find the new event, you can apply a \[Name\]\[contains\]\[text_index\] filter and sort the Event list view by Created date/time in descending (z to a) order.

## Result

The system updates the text index for the specified record in the specified table.

## What to do next

Repeat your sample search. If this search returns the identified record, you may want to update the text index for the entire table that contains that record. For details, see [Regenerate a text index for a table](https://www.servicenow.com/docs/CgkfvqfeKq4_FDgLRdXvjQ "You can regenerate a table text index when you change table stop words or display values.").

*[\>]: and then


