Add transactionId (for internal harvester usage. Add dates as both date and string...
[lui-solr.git] / scripts / delete_solr.sh
1 #!/bin/bash
2
3 HOST_PORT="localhost:8080"
4
5 if [ "$2" != "" ] ; then 
6     HOST_PORT="$2"
7 fi 
8
9 PATH=solr4
10 if [ "$3" != "" ] ; then 
11     PATH="$3"
12 fi
13
14 if [ "$1" == "" ] ; then 
15     echo "$0 databaseid [[HOST:PORT] PATH] (default $HOST_PORT/$PATH)"
16     exit 1 ; 
17 fi  
18
19 curl http://${HOST_PORT}/$PATH/update -H "Content-Type: text/xml" --data-binary "<delete><query>database:$1</query></delete>"
20 curl http://${HOST_PORT}/$PATH/update -H "Content-Type: text/xml" --data-binary '<commit waitFlush="false" waitSearcher="false"/>'