Commit 95792041 authored by Yaroslav's avatar Yaroslav
Browse files

docker and getting data scripts

parent 72e53863
data
var-solr
\ No newline at end of file
version: '3'
services:
solr:
image: solr:8
ports:
- "8983:8983"
volumes:
- ./var-solr:/var/solr
- ./demo:/opt/solr/server/solr/configsets/demo
command: solr-precreate demo /opt/solr/server/solr/configsets/demo
\ No newline at end of file
#!/bin/bash
YELP_DATA=yelp.tgz
case "$1" in
"get-yelp")
mkdir -p data
wget https://at.ispras.ru/owncloud/index.php/s/ilMufYYEqA8bUvT/download -O data/$YELP_DATA
;;
"reindex-yelp")
if [ -f data/$YELP_DATA ]; then
# stop container
$0 down
# cleanup
sudo rm -rf var-solr
sudo mkdir var-solr
sudo chown 8983:8983 var-solr
# start
$0 all
# index all data (decompress on the fly and pass to index)
tar xzf data/$YELP_DATA final.json -O | curl 'http://localhost:8983/solr/demo/update?commit=true' --data-binary @- -H 'Content-type:application/json'
else
echo "Please use ./run get-yelp to obtain yelp data"
fi
;;
"all")
sudo docker-compose down && sudo docker-compose up -d
;;
"down")
sudo docker-compose down
;;
"-h"|"--help"|*)
echo "You have failed to specify what to do correctly."
echo "Available options:"
echo '"./run get-yelp" downloads yelp data from owncloud into data/ directory.'
echo '"./run reindex-yelp" drops existing demo indices and builds a new one using yelp data.'
echo '"./run all" starts everything'
echo '"./run down" stops containers and removes them.'
exit 1
;;
esac
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment