-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"/>'