solr Client

  • Home
  • Solr Client
  • APIs
    • JAVA
    • PHP
    • Shell
  • Links
PHP Clients
  • Apache Solr PHP Extension
  • Generic PHP Client
  • SolrQuery - PHP query client for Solr
  • SolrUpdate - PHP update client for Solr
  • solr-php-client
API Clients
  • Apache Solr PHP Extension
  • Haystack for Django
  • Flash Client: solr-sunspot
  • Minig's Solr Client
  • solrpy
  • Django Solr
  • Post Multiple Files to a Solr Server
  • Solr Delete Post for Shells
  • Generic PHP Client
  • SolrJ
Other Clients
  • Solr for WordPress
  • Drupal 5 Solr
  • solr Client
Home

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 '' -H 'Content-type:text/xml; charset=utf-8'

Add new comment |  Tags: API, Shell

Search

Contact Us | Terms of Use | Trademarks | Privacy Statement
Copyright © 2010 solr Client. All Rights Reserved.

Powered by Drupal and Drupal Theme created with Artisteer.