Friday, September 3, 2010

Update CSV File to Solr

By Default, Solr has several RequestHandlers that been mapped to different URLs.

you can check these settings in the solr.xml

image
so you can post document (xml format) to /update
or CSV document to /update/csv

Here is one quick example.

Let's say you have a simple CSV file named EE.csv

id;title
1;AndroidYou
2;David

post via CSV
run

curl "http://localhost:8080/solr/update/csv?commit=true&separator=%3b" --data-binary @ee.csv -H "Content-Type:text/plain"

then you may query

http://localhost:8080/solr/select/?q=id:2 OR id:1 to see these documents



No comments:

 
Locations of visitors to this page