Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (27 sloc) 2.19 KB
#!/usr/bin/env bash
#download solr-7.7.2 from
echo "start download solr-7.7.2 from"
curl "" -o solr-7.7.2.tgz
tar -xvf solr-7.7.2.tgz
echo "start prepare the jar files"
#set up solr (we use gradle to build the package , please make sure you already install it, the version we use in the demo is 4.10.1
cd ../../../../ && gradle clean jar && rm -rf src/main/resources/demo/solr_home/lib && mkdir src/main/resources/demo/solr_home/lib && cp build/libs/customized-codec-1.0-SNAPSHOT.jar src/main/resources/demo/solr_home/lib
# build the index jar
gradle -PallInOne clean jar && rm -rf src/main/resources/demo/*.jar && cp build/libs/customized-codec-1.0-SNAPSHOT.jar src/main/resources/demo/
# start download the data file
echo "start download the data file"
cd src/main/resources/demo/ && curl "" -o && unzip && mv 20*/download/patent.tsv ./patent.tsv && rm -rf 20*
echo "start CODEC solr and index data"
# start solr and index the data
./solr-7.7.2/bin/solr start -p 8983 -m 1G -s solr_home && java -cp customized-codec-1.0-SNAPSHOT.jar org.fql.codec.index.IndexPatentData patent.tsv 2
# execute the query
curl "*:*&facet=true&facet.field=type&facet.limit=10&wt=json&indent=on&rows=0"
# start hack the indexing
echo "start stop Solr and hack Lucene Index"
rm -rf newIndex && mkdir newIndex && ./solr-7.7.2/bin/solr stop -p 8983
java -cp customized-codec-1.0-SNAPSHOT.jar:solr_home/lib/customized-codec-1.0-SNAPSHOT.jar org.fql.codec.index.GeneratePerFieldIndex solr_home/CODEC/data/index type false newIndex
# stop solr and done
echo "start solr and execute query , you should see 'utility' has been change to 'fql_demo' "
./solr-7.7.2/bin/solr start -p 8983 -m 1G -s solr_home
curl "*:*&facet=true&facet.field=type&facet.limit=10&wt=json&indent=on&rows=0"
rm -rf newIndex && ./solr-7.7.2/bin/solr stop -p 8983
You can’t perform that action at this time.