Skip to content

Instantly share code, notes, and snippets.

@selam
Forked from emre/solr_document_remover.py
Created July 29, 2010 09:52
Show Gist options
  • Save selam/497743 to your computer and use it in GitHub Desktop.
Save selam/497743 to your computer and use it in GitHub Desktop.
import solr
# create a connection to a solr server
s = solr.SolrConnection('http://foo/bar/:8180/solr')
# get all documents,
response = s.query('*:*')
# start to loop for delete all data
while response:
for hit in response.results:
s.delete(hit['id'])
s.commit()
# get next 10 result
response = response.next_batch()
@emre
Copy link

emre commented Jul 29, 2010

nice work :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment