This project is not covered by Drupal’s security advisory policy.

Search API Integrity will check that a Search API index really holds what Drupal thinks it holds. Search API counts indexed items from Drupal's own tracker table, so after a database clone or a site-hash change an index can read "100% indexed" while the backend is empty or full of another copy's documents.

Status: No release yet. The module is under active development; the first beta follows once its automated test suite and an independent review pass.

This module is developed with AI assistance. The maintainer reviews and tests every release before publishing it.

Planned for 1.0

None of this is released yet. The first release will provide:

Checks, per index

  • Three figures side by side: what the tracker says is indexed, what the backend actually holds for this index and this site hash, and how many entities the datasources contain.
  • Documents left under other site hashes after a database clone or a site-hash change, listed by hash with a count for each.
  • A backend that is empty, or far behind, while the tracker says the index is complete, as when a cloned database points at a fresh Solr core.
  • Orphaned documents for entities that no longer exist, found by sampling.
  • Schema or configset mismatches, using Search API Solr's own checks, and the "inconsistent index options" failure that makes Solr reject every write.
  • An index on a disabled or unreachable server.

Repairs, each behind a confirmation form

  • Delete only one stale site hash's documents. It never deletes everything in a core (*:*), so other indexes and sites sharing the core are left alone.
  • Mark the index for reindexing when the backend is empty.
  • Delete orphaned documents.

Where it reports

  • Entries on the status report.
  • An "Integrity" tab on each index.
  • Drush: search-api-integrity:check, with JSON output and a non-zero exit code for deploy pipelines (the documentation will include an example to run after a database clone), and search-api-integrity:repair.

The checks are backend-agnostic, with a plugin for Search API Solr. The database backend is supported where a check applies to it.

Requirements

Planned for the first release:

  • Drupal 11.3 or later, or Drupal 12.
  • PHP 8.3 or later.
  • Search API.
  • For the Solr checks: Search API Solr. On Drupal 12 these need a Search API Solr release that supports Drupal 12.

Installation

Installation instructions arrive with the first release. For the first beta, the commands will be:

composer require 'drupal/search_api_integrity:^1.0@beta'
drush en search_api_integrity

Configuration and permissions

Not final yet. This section will list each settings page and each permission, by its real label, with the first release.

The repairs delete data from the search backend, so the permission that allows them will be marked restricted.

Similar projects

Checked on drupal.org in November 2026.

  • Search API's own status page and drush search-api:status report the tracker's figures. They are the right place to watch indexing progress; they do not ask the backend what it holds.
  • Drupal Site Audit runs many site-health checks, one of which reports Search API server and index status. Choose it for a broad audit of a site; this module goes deep on one question and repairs what it finds.
  • Without a module, the documented remedy for leftover documents in Solr is a *:* delete from the Solr admin, which also removes every other index on a shared core.

Support and maintenance

Report bugs, ask for features and comment on the planned scope in the issue queue. Each release will have notes describing what changed.

This project is not covered by Drupal's security advisory policy. Until it is, security issues are handled in the public issue queue and fixed in ordinary releases.

A read-only mirror is on GitHub at DanePete/drupal-search-api-integrity. It will mirror the drupal.org repository once code is published there; development and issues stay on drupal.org.

Maintainer

Created and maintained by deadnorth (Dead North).

Project information

Releases