Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Regenerate a corrupt index

Regenerate a corrupt index

Typically, a corrupt index regenerates itself. If the system does not start the regeneration process, you must issue a script command to delete the existing index and regenerate it.

Procedure

  1. Navigate to System Definition > Scripts - Background.
  2. In Run Script box, type the syntax for the background script:
    To regenerate the task text index, the following could be used as a background script:
    var indexer = new Packages.com.glide.lucene.TextIndexEvent();
       indexer.createIndex("task", "my_email@service-now.com");
    

    Change the email address to the address that receives the notification when the index is completed. The script creates an event that the index handler processes so the script completes almost instantly.

  3. Click the Run script button.
  4. When the scheduled job picks up the event, you can check the Component Status page and see that the index is being generated. An entry also appears in the log, as shown in the following example:
     10/28/09 15:36:19 (521) worker.1 worker.1 TextIndexGenerator: Text index generation starting for: task
    

Result

As each extended table completes, it is logged:
 10/28/09 15:37:13 (213) worker.1 worker.1 [0:00:01.462] TextIndex generation complete for: problem, rows indexed: 11
After all the extended tables are completed, the Component Status page entry is updated to "completed" and a final log entry is made. The log entry shows how long the process took.
  10/28/09 15:37:20 (794) worker.1 worker.1 TextIndexGenerator: Text index generation complete for: task, in: 0:01:02.669

Updates to site content will be made starting around 4am on January 17th (Pacific Time) and lasting approximately 6 hours.  This site may be intermittently unavailable.