Created
March 14, 2013 19:00
-
-
Save sstults/5164172 to your computer and use it in GitHub Desktop.
Reads three words on a line from STDIN, then uses the first and last to post an update to Solr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while read line | |
do | |
declare -a arr=( $line ) | |
curl --url "http://localhost:8983/solr/us_patent_grant/update/?commit=false" \ | |
-H "Content-Type: text/xml" -d "<add><doc><field name='id'>0${arr[0]}</field><field name='page_count_int' update='set'>${arr[2]//[[:space:]]/}</field></doc></add>" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment