Skip to content

Instantly share code, notes, and snippets.

@sstults
Created March 14, 2013 19:00
Show Gist options
  • Save sstults/5164172 to your computer and use it in GitHub Desktop.
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
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