Tuesday, September 24, 2013

Delete/Clear Solr

Here is the simple shell script I use for clearning everything from Solr .
!/bin/sh
URL="http://user:password@host:portnum/solr.master/core/update"
DATA="<delete><query>*:*</query></delete>"
echo Posting "\"$DATA\"" to "\"$URL\"" with commit=true
curl $URL?commit=true -H "Content-Type: text/xml" --data-binary $DATA
echo Complete