Moved scripts
[lui-solr.git] / scripts / optimize_solr.sh
diff --git a/scripts/optimize_solr.sh b/scripts/optimize_solr.sh
new file mode 100755 (executable)
index 0000000..bb4127d
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+if [ "$1" != "YES" ] ; then 
+    echo "No confirmation given"
+    exit 1 ; 
+fi  
+
+HOST_PORT=localhost:8080
+
+if [ "$2" != "" ] ; then 
+    HOST_PORT="$2"
+fi
+
+curl http://${HOST_PORT}/solr/update -H "Content-Type: text/xml" --data-binary '<optimize waitSearcher="false" expungeDeletes="true" />'