Indexed source retention policies and filter conditions

  • Release version: Zurich
  • Updated July 2, 2026
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Indexed source retention policies and filter conditions

    This content explains how ServiceNow customers can manage the volume and relevance of records indexed by AI Search from source tables. By configuring retention policies and filter conditions, you can control which records are indexed and ensure that stale data is efficiently purged, optimizing search performance and resource use.

    Show full answer Show less

    Indexed source retention policies

    Retention policies allow you to limit indexing to records updated within a specific time frame. For example, selecting a two-year retention policy means AI Search will exclude records last updated more than two years ago. When a record exceeds this time limit, its indexed counterpart is marked as stale and later purged.

    Important: Retention policies are required for sources indexing records from the Task [task] table or its extensions, and optional for other tables.

    Indexed source filter conditions

    Filter conditions define criteria that records must meet to be indexed. AI Search only indexes records matching all specified conditions, enabling you to reduce index size by excluding certain records, such as frequently updated open tasks by status.

    Note that while filter conditions reduce the number of records indexed per indexing event, they do not reduce the number of indexing events triggered by changes to the source table, except for changes to columns marked with the notextindex setting.

    Purging stale records

    AI Search automatically purges stale indexed records daily to maintain index accuracy and efficiency. Administrators with the admin role can also trigger manual purging by executing a scheduled job designed to delete stale records from the AI Search index.

    To limit the set of records indexed from source tables, you can configure retention policies and filter conditions for your indexed sources. AI Search also uses these settings to automatically purge stale records from the index, optimizing search performance.

    Indexed source retention policies

    Indexing large source tables, such as the Task [task] table and tables that extend it, can add significant numbers of records to the AI Search index. To limit the set of source table records indexed based on the time since they were last updated, select a retention policy for your indexed source.

    AI Search only indexes source records updated within the time period defined for the retention policy. For example, if you select a two-year retention policy, AI Search excludes source records that were last updated more than two years ago.

    When the time since a source record's last update exceeds the limit from the indexed source's retention policy, AI Search marks the corresponding indexed record as stale.
    Note:
    Retention policies are required for indexed sources that index records from the Task [task] table or tables that extend it. They are optional for other indexed sources.

    Indexed source filter conditions

    To limit the set of records indexed from a source table, define filter conditions for your indexed source. AI Search only indexes records that match all defined filter conditions.

    Adding filter conditions can reduce the number of records indexed from a source table and reduce indexing frequency. As an example, if you exclude frequently updated open records based on their status, AI Search doesn't index data from those records, reducing your index size and the compute resources needed to index changes from the source table.

    When a source record no longer satisfies the indexed source's filter conditions, AI Search marks the corresponding indexed record as stale.
    Note:
    . Adding filter conditions doesn't reduce the number of AI Search indexing events generated for the indexed source. The system generates indexing events for every change to an indexed source table, unless the change is to a column that has a no_text_index field setting defined in the indexed source. The filter condition can reduce the number of records indexed for each event, however.

    Purging stale records

    AI Search automatically purges stale records from the index daily. Users with the admin role can manually purge stale records. For details on this procedure, see Purge stale records from the AI Search index.