Rebuilding the Archive Index

This article describes the purpose of, and procedure for, rebuilding the Microsoft Azure AI Search index used by the Straatos Archive.

Overview

The Straatos Archive search index is continuously updated whenever documents are added to or deleted from the archive. These changes are synchronised between the SQL database and the Azure AI Search index.

Over time, certain situations may require a full rebuild of the index:

  • Configuration changes:

    • In the Straatos Archive (for example, removing index fields for specific document types). In this case, existing documents are not automatically updated in the search index—only newly added documents reflect the new configuration.

  • Manual changes:

    • Made directly in the SQL database related to search data. These changes are not synchronised back to Azure AI Search.

In such scenarios, the search index may contain outdated or unnecessary data, making it larger and less efficient. A full rebuilding of the index is required to bring the search index back into a consistent state.


Permissions and Prerequisites

  • The user must be authenticated.

  • The user must have tenant administrator permissions.

  • Ensure sufficient storage quota is available in Azure AI Search.

triangle-exclamation

Starting a Rebuild

The rebuild is triggered via the following API call:

Replace {tenantId} with the appropriate tenant identifier.


Behaviour During Rebuilding of the index

  • Users can continue to search and retrieve documents as usual.

  • No documents can be added or updated in the archive while rebuild is in progress.

  • Rebuilding of the index can take a significant amount of time.

circle-info

As a guideline, rebuilding a 10 GB search index takes approximately 12–13 hours.


Monitoring the rebuild Progress

You can monitor the progress and logs of the rebuild process using the following API call:

This endpoint returns the current status of the index rebuild and any errors encountered.

Example Log Output (Successful Rebuild)

If the rebuild completes successfully, the new index is automatically activated. If errors occur, the new index is not activated and the existing index remains in use.


Listing Search Indexes

To list the search indexes known to the Straatos Archive, use the following API call:

This returns the indexes as recorded in the Straatos database.

triangle-exclamation

Example Response

In this example, two indexes exist. The active flag and timestamps indicate which index is currently in use and which one is older.


Cleaning Up Old Indexes

After the new index has been tested and confirmed to work correctly, the old index must be removed manually to free up Azure AI Search storage quota.

  1. Open the Azure Portal.

  2. Navigate to the Azure AI Search service.

  3. Delete the index that is no longer active.

Remove the Index from the Straatos Database

After deleting the index in Azure AI Search, remove the corresponding entry from the Straatos SQL database.

Retrieve the existing index entries:

Delete the unused index entry:

Replace {your id} with the ID of the index you want to remove.

Last updated