Fix PATH overriding
[lui-solr.git] / scripts / optimize_solr.sh
index bb4127d..83e4219 100755 (executable)
@@ -1,14 +1,20 @@
 #!/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" />'
+SOLR_PATH=solr4
+if [ "$3" != "" ] ; then 
+    SOLR_PATH="$3"
+fi
+
+if [ "$1" != "YES" ] ; then 
+    echo "$0 YES [[HOST:PORT] SOLR_PATH] (default $HOST_PORT/$SOLR_PATH)"
+    exit 1 ; 
+fi  
+
+
+curl http://${HOST_PORT}/$SOLR_PATH/update -H "Content-Type: text/xml" --data-binary '<optimize waitSearcher="false" expungeDeletes="true" />'