Drush command to fully clear indexed items from Solr server (not just locally)

Created on 11 June 2025, about 2 months ago

Setup

  • Solr version: 8.11.3
  • Drupal Core version: 11
  • Search API version: 1.38.0
  • Search API Solr version: 4.3.10
  • Configured Solr Connector: Standard HTTP connector

Issue

The current Clear all indexed data button in the Search API interface only removes the indexed items locally β€” i.e., from the Drupal database. However, previously indexed documents remain on the Solr server, especially after repeated migrations or test imports.

As a result, phantom or duplicate results appear in the Solr search, even though the corresponding content no longer exists in Drupa

Proposed solution

This fork introduces a **Drush command**:
drush search-api-solr:delete-all-items

This command:

  • Deletes all documents from the specified Solr server.
  • Prevents outdated or duplicate Solr results after migrations or rollbacks.
  • Complements the existing "Clear all indexed data" functionality by performing the cleanup on the Solr side.

This is especially useful in development or testing environments where re-indexing happens frequently.

✨ Feature request
Status

Active

Version

4.3

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine katlion

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024