Scripts to commit, optimize or delete on a solr index
[lui-solr.git] / delete_solr.sh
diff --git a/delete_solr.sh b/delete_solr.sh
new file mode 100755 (executable)
index 0000000..8a586ae
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if [ "$1" == "" ] ; then 
+    echo "No database id given"
+    exit 1 ; 
+fi  
+HOST=localhost
+PORT=8080
+curl http://$HOST:$PORT/solr/update -H "Content-Type: text/xml" --data-binary "<delete><query>database:$1</query></delete>"
+curl http://$HOST:$PORT/solr/update -H "Content-Type: text/xml" --data-binary '<commit waitFlush="false" waitSearcher="false"/>'
\ No newline at end of file