Skip to content

Instantly share code, notes, and snippets.

@peterkraume
Created March 30, 2015 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterkraume/f31780e2271b0c8e5a3e to your computer and use it in GitHub Desktop.
Save peterkraume/f31780e2271b0c8e5a3e to your computer and use it in GitHub Desktop.
delete documents from multiple Solr cores
#!/bin/bash
query="indexed:[2000-01-01T00:00:00Z TO 2015-03-20T00:00:00Z] AND type:tx_solr_file"
host="http://localhost:8080/solr/"
cores="
core_de \
core_en \
core_fr"
for core in $cores; do
echo "##### Deleting from core $core #####"
curl $host$core"/update?commit=true" -H "Content-Type: text/xml" --data-binary "<delete><query>$query</query></delete>"
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment