Add scripts to package 0.3.x
authorDennis Schafroth <dennis@indexdata.com>
Tue, 20 Aug 2013 11:19:57 +0000 (13:19 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Tue, 20 Aug 2013 11:19:57 +0000 (13:19 +0200)
scripts/commit_solr.sh [new file with mode: 0644]
scripts/delete_solr.sh [new file with mode: 0755]
scripts/optimize_solr.sh [new file with mode: 0755]

diff --git a/scripts/commit_solr.sh b/scripts/commit_solr.sh
new file mode 100644 (file)
index 0000000..0cb3a43
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ "$1" == "" ] ; then 
+    echo "No database id given"
+    exit 1 ; 
+fi  
+HOST=localhost
+PORT=8080
+curl http://$HOST:$PORT/solr/update -H "Content-Type: text/xml" --data-binary '<commit waitFlush="false" waitSearcher="false"/>'
\ No newline at end of file
diff --git a/scripts/delete_solr.sh b/scripts/delete_solr.sh
new file mode 100755 (executable)
index 0000000..2b91d65
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+if [ "$1" == "" ] ; then 
+    echo "$0 databaseid [HOST:PORT] "
+    exit 1 ; 
+fi  
+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"/>'
diff --git a/scripts/optimize_solr.sh b/scripts/optimize_solr.sh
new file mode 100755 (executable)
index 0000000..90d9a26
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ "$1" != "YES" ] ; then 
+    echo "No confirmation given"
+    exit 1 ; 
+fi  
+HOST=localhost
+PORT=8080
+curl http://$HOST:$PORT/solr/update -H "Content-Type: text/xml" --data-binary '<optimize waitSearcher="false" />'
\ No newline at end of file