Other Clients
Post Multiple Files to a Solr Server
Tue, 03/23/2010 - 14:22 | admin
This shell script will post all xml files found in the /exports/xml directory to a solr installation on the localhost. The xml files must end with 'xml'. Once the xml file is posted the file is renamed added the date as a suffix.
#!/bin/sh
URL=http://localhost:8080/solr/update
for f in `ls ./exports/xml/*xml`
do
echo posting $f;
curl $URL --data-binary @$f -H 'Content-type:text/xml; charset=utf-8'
name=`date +%F_%T`;
mv $f ${f}_${name}
#gzip ${f}_${name}
done
echo "commiting. . . ";
curl $URL --data-binary '