Mercurial > hg > LGDataverses
diff scripts/search/add @ 10:a50cf11e5178
Rewrite LGDataverse completely upgrading to dataverse4.0
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Tue, 08 Sep 2015 17:00:21 +0200 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/search/add Tue Sep 08 17:00:21 2015 +0200 @@ -0,0 +1,23 @@ +#!/bin/sh +# need the following in solr/collection1/conf/schema.xml +# <field name="entityid" type="long" indexed="true" stored="true" required="true" multiValued="false" /> +# <field name="type" type="string" indexed="true" stored="true" required="true" multiValued="false" /> +mkdir -p data +#echo "adding to solr..." +curl -s http://localhost:8080/api/dataverses > data/dataverses.json +#curl http://localhost:8983/solr/update/json?commit=true -H 'Content-type:application/json' --data-binary @data/dataverses.json + +curl -s http://localhost:8080/api/datasets > data/datasets.json +#curl http://localhost:8983/solr/update/json?commit=true -H 'Content-type:application/json' --data-binary @data/datasets.json + +echo "adding to elasticsearch..." +#curl -XPOST http://localhost:9200/dataverse/datasets/1 --data-binary @data/datasets/1.dump +for type in dataverses datasets; do + mkdir -p data/$type + for i in `./json2ids data/$type.json`; do + #echo "adding $i from $type..." + curl -s http://localhost:8080/api/$type/$i/dump > data/$type/$i.dump + curl -XPOST "http://localhost:9200/dataverse/$type/$i" --data-binary @data/$type/$i.dump + echo + done; +done
