Skip to content

Instantly share code, notes, and snippets.

@shalinmangar
Created August 27, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shalinmangar/de8a9af5577ff000e556 to your computer and use it in GitHub Desktop.
Save shalinmangar/de8a9af5577ff000e556 to your computer and use it in GitHub Desktop.
#!/bin/bash
booklink=http://www.gutenberg.org/ebooks/1322.txt.utf-8
bookfile=leaves.json
if [ ! -f $bookfile ] ; then
wget $booklink -O $bookfile
fi
booksize=`ls -lh $bookfile | awk '{ print $5 }'`
echo "$bookfile is $booksize"
contents=`cat leaves.json`
targetsizesMB="10 100"
destdir=./solr-7971-data
mkdir -p $destdir
for n in 14 140; do
# remove file if there...
if [ -f $destdir/input.$n.json ]; then rm -f $destdir/input.$n.json ; fi
if [ ! -f $destdir/input.$n.json ]; then
echo -n '[{"id":"jsondoc1","content":"' >>$destdir/input.$n.json
for i in `seq $n` ; do
echo -n $contents >>$destdir/input.$n.json
done
echo -n '"}]' >>$destdir/input.$n.json
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment