Delete By Query

Remove the documents that match a query

Delete By Query

Delete By Query removes every document of your Opensolr Index that matches a query. Use it to clear out part of an index without touching the rest.

No preview, no undo

Clicking Delete removes every match at once. There is no confirmation step, and *:* matches every document in the index. Check your query first (below).

01 · Steps

  1. Open the control panel of the index and click Tools in the left menu.
  2. Type your query in the Delete By Query box. The panel's own example: uri:*site.com/path removes all URLs containing site.com/path.
  3. Click Delete. The answer reads “Request Sent. DATA DELETED OK”.

No Commit is needed: the documents leave the search results right away. Their disk space is freed when Solr merges the index, or at once with Optimize.

02 · Check your query first

Run the same query as a search and look at numFound: that is how many documents Delete would remove. Click Solr Query in the Quick Actions bar and replace q=*:* in the address with your query.

03 · Query examples

The query uses the standard Solr syntax and the field names of your schema.

To removeQuery
every URL under a pathuri:*site.com/path*
one documentid:12345
documents older than a year, by a date field of your schemayour_date_field:[* TO NOW-1YEAR]
every document (same documents as Reset)*:*

Want everything gone and a clean start? Reset does that in one click.

Index Tools