-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.sh
More file actions
executable file
·49 lines (39 loc) · 803 Bytes
/
index.sh
File metadata and controls
executable file
·49 lines (39 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
JAR=target/index.jar
DIR=/var/corpora/covid
ES="http://localhost:9200"
SOLR="http://129.114.16.34:8983/solr"
THREADS=4
INDEX=cord_askme
function solr() {
java -jar $JAR --input $DIR -b 1000 -t $THREADS --cord19 --core $INDEX --solr $SOLR
}
function elastic() {
java -jar $JAR --input $DIR -b 1000 -t $THREADS --cord19 --core $INDEX --elastic $ES
}
if [[ -z $1 ]] ; then
run
exit
fi
if [[ -n $2 ]] ; then
INDEX=$2
fi
case $1 in
create)
curl -i -X PUT -d @src/main/resources/mappings.json -H "Content-type: application/json" $ES/$INDEX
echo ""
;;
delete)
curl -i -X DELETE $ES/$INDEX
;;
mappings)
curl $ES/$INDEX/_mappings | jsonpp
;;
run)
solr
;;
*)
echo "Invalid option: $1"
echo "USAGE ./index [create|delete|mappings|run]"
echo ""
esac