This will explain how to determine if a text index or reindex has completed, and if not, how to check the progress of text indexing events processing.
This can be useful in troubleshooting the following situations as well as others.
- A new or recently updated record is not returned in search results because text indexing events are still running.
- A table is not returning results after a clone because text index is still running.
- After enabling text indexing on a table no results are returned
- To begin with, if you have just cloned your instance we do not clone text indexes which means there can be a substantial delay for text indexing to work after a clone as all the indexes are rebuilt after the clone completes.
- Navigate to System Definition > Text Indexes.
- Search for and select the index which is not returning results.
- If you can't find a record for the table you are indexing, it may that the table is parented by another table such as sys_metadata or task. Text indexes are build against the highest level parent table.
- If this is for a new index and not a task or system table, the record may not show until the job is scheduled so continue on to verify the status of the Job.
- If the state is Indexing go to step 8 to check the event queue processing.
- If it is not indexing yet the state will say Ready, so we need to check that the Job is scheduled.
- Navigate to System Scheduler > Scheduled Jobs > Scheduled Jobs (sys_trigger table).
- Search for and open the record for 'text index events process'.
- Verify that the state is not Error and that the Next action shows as being in the very near future. This job is normally set to run every 30 seconds unless it has been changed.
- That job should be getting processed at 30 second intervals on one of the available nodes. If it has been running for longer than normal it will show up under the Scheduled Workers on the stats.do page of the node it is running on. If you are not a ServiceNow support person you may not be able to access all the nodes to validate this in which case a support engineer can assist in checking this for you.
- Once the job is running you can check its progress in the events table.
- Navigate to System Logs > Events.
- Filter by Name = 'text_index' and Processing Duration (is empty) and State is not transferred.
- This will give you a list of text index events which still need to be processed.
- These are processed chronologically, so if another index or large update to an already indexed table started before the one you are investigating that may be why the index you are concerned with has not completed.
- You can filter by the Table column and then check the Created times to see which events will be indexed first.
- Once all of the events are processed the index should be complete.