Deleting Documents from Solr

Often when using Solr, I forget what the command is to delete documents so I’m just keeping it here. This command will both delete the documents matched by the query and commit the deletion.

http://hostname/solr/update?stream.body=<delete><query></query></delete>&commit=true

Query is format field:value. To delete all of your documents enter *:*

BTW – if you do this from a browser make sure that you close the browser window when you are finished.  I once had Firefox crash and then when it came up I opted to recover the closed windows.  This instantly executed this command and deleted all of my documents.  it was not a good feeling.

Talk to you soon,

Orville | Twitter: @orville_m

Advertisements

Author: Orville McDonald

I love technology and business but I get really excited when both intersect in interesting ways. Having been both a product manager and a product marketer, I am on assignment meeting developers from around the world to see how we can help. All opinions written here are my own.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s