Configurable host
authorDennis Schafroth <dennis@indexdata.com>
Thu, 25 Apr 2013 09:26:36 +0000 (11:26 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Thu, 25 Apr 2013 09:26:36 +0000 (11:26 +0200)
delete_solr.sh

index 8a586ae..2b91d65 100755 (executable)
@@ -1,10 +1,14 @@
 #!/bin/bash
 
 if [ "$1" == "" ] ; then 
-    echo "No database id given"
+    echo "$0 databaseid [HOST:PORT] "
     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
+HOSTPORT="localhost:8080"
+
+if [ "$2" != "" ] ; then 
+    HOSTPORT="$2"
+fi 
+
+curl http://${HOSTPORT}/solr/update -H "Content-Type: text/xml" --data-binary "<delete><query>database:$1</query></delete>"
+curl http://${HOSTPORT}/solr/update -H "Content-Type: text/xml" --data-binary '<commit waitFlush="false" waitSearcher="false"/>'