Reindex a table without impacting text search results

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 4분
  • 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.

    시작하기 전에

    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.

    Role required: admin
    주:
    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].

    이 태스크 정보

    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.

    프로시저

    1. Navigate to All > System Definition > Scripts - Background.
      주:
      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.
    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.
        주:
        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 null for no email notification.
      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.

    결과

    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.