{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":39539,"path":"platform-administration/search-administration/regenerate-text-index-one-record.md","title":"Regenerate the text index for a single record","bundle":null,"doc_type":null,"release":"australia","body":"\n# Regenerate the text index for a single record\n\nUpdate 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.\n\n## Before you begin\n\nIdentify the following:\n\n-   A search term that doesn't return the expected results\n-   A record containing the identified search term that isn't returned when searching for the term\n-   The table that includes the identified record\n\nThe 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/configure-single-table-for-indexing.md).\n\nRole required: admin\n\n**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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/sc-restrict-access-to-background-script.md).\n\n## About this task\n\nThis 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.\n\nYou 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.\n\n## Procedure\n\n1.  Copy the sys\\_id for the identified record by selecting **Copy sys\\_id** from its context menu.\n\n2.  Navigate to **All** &gt; **System Definition** &gt; **Scripts - Background**.\n\n    **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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/c_ElevatedPrivilege.md).\n\n3.  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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/regenerate-text-index-one-record.md):\n\n    ```\n    var gr = new GlideRecord('TABLE_NAME');\n    gr.get('SYS_ID');\n    gs.eventQueue(\"text_index\", gr, '[TABLE_NAME]','update','text_index');\n    ```\n\n4.  Select **Run script**.\n\n    The script creates a text\\_index update event for the specified table in the text\\_index queue.\n\n5.  Navigate to **All** &gt; **System Policy** &gt; **Events** &gt; **Event Log** and wait for the new text\\_index update event's state to change to **processed**.\n\n    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.\n\n\n## Result\n\nThe system updates the text index for the specified record in the specified table.\n\n## What to do next\n\nRepeat 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/t_RegenerateATextIndexForATable.md).\n\n**Parent Topic:**[Regenerate a text index for a table](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/search-administration/t_RegenerateATextIndexForATable.md)\n\n"}}