2b91d6514e1bd80c544efb21f60d3bc3829cc292
[lui-solr.git] / scripts / delete_solr.sh
1 #!/bin/bash
2
3 if [ "$1" == "" ] ; then 
4     echo "$0 databaseid [HOST:PORT] "
5     exit 1 ; 
6 fi  
7 HOSTPORT="localhost:8080"
8
9 if [ "$2" != "" ] ; then 
10     HOSTPORT="$2"
11 fi 
12
13 curl http://${HOSTPORT}/solr/update -H "Content-Type: text/xml" --data-binary "<delete><query>database:$1</query></delete>"
14 curl http://${HOSTPORT}/solr/update -H "Content-Type: text/xml" --data-binary '<commit waitFlush="false" waitSearcher="false"/>'