Tests on SOLR, plottable data out of pazpar2, plot script
[pazpar2-moved-to-github.git] / heikki / solr / run.sh
1 #!/bin/bash
2 #
3 # Run the test with a number of queries, plot the results
4
5
6 if [ "$1" == "" ]
7 then
8   echo "Need an argument, the name of this test run"
9   echo "It will be in the title of all plots, together with the query"
10   exit 1
11 fi
12 TITLE="$1"
13 OUTFILE=`echo $1.txt | sed 's/ /_/g'`
14 echo "$TITLE" > $OUTFILE
15 ./test3.sh clean
16
17 function onerun() {
18     QRY="$1"
19     echo "" >> $OUTFILE
20     echo "Query: $QRY" >> $OUTFILE
21     PNG=`echo "solr_$TITLE $QRY.png" | sed 's/ /_/g' `
22     echo "Graph: $PNG" >> $OUTFILE
23     ./test3.sh "$QRY" "$TITLE"
24     grep "plotline" show.out | head -10 >> $OUTFILE
25     cp plot.png $PNG
26 }
27
28 onerun "harry potter"
29 onerun "vietnam war"
30 onerun "water or fire or ice"
31 echo "" >> $OUTFILE
32 echo "client#, position, tf/idf, roundrobin, solr # database # title" >> $OUTFILE
33