From d0fd447b713599adfb50f4b4c7a21efe7a3466e3 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Wed, 20 Nov 2013 15:52:29 +0100 Subject: [PATCH] beginnings of a small script --- HEIKKI-TODO | 15 --------------- heikki/README-HEIKKI | 18 ++++++++++++++++++ heikki/test1.cfg | 16 ++++++++++++++++ heikki/test1.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 15 deletions(-) delete mode 100644 HEIKKI-TODO create mode 100644 heikki/README-HEIKKI create mode 100644 heikki/test1.cfg create mode 100755 heikki/test1.sh diff --git a/HEIKKI-TODO b/HEIKKI-TODO deleted file mode 100644 index c557486..0000000 --- a/HEIKKI-TODO +++ /dev/null @@ -1,15 +0,0 @@ -Heikki's private notes for the ranking-h branch - -Things to experiment with, and find out, and mess about - -Goals: - - Understand the ranking - - make a better ranking merging algorithm - - - - -Tue 19-Nov-2013 Started this branch - - - diff --git a/heikki/README-HEIKKI b/heikki/README-HEIKKI new file mode 100644 index 0000000..238a7b2 --- /dev/null +++ b/heikki/README-HEIKKI @@ -0,0 +1,18 @@ +Heikki's experiments with ranking + +Personal notes, likely to be out of date. + +Things to experiment with, and find out, and mess about + +Goals: + - Understand the ranking + - make a better ranking merging algorithm + + + + +Tue 19-Nov-2013 Started this branch + + +Wed 20-Nov-2013 Make a script that tests ranking against yaz-zserver +(as that is the default config). Mostly to have a script to build on later. diff --git a/heikki/test1.cfg b/heikki/test1.cfg new file mode 100644 index 0000000..129d2aa --- /dev/null +++ b/heikki/test1.cfg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/heikki/test1.sh b/heikki/test1.sh new file mode 100755 index 0000000..14032e9 --- /dev/null +++ b/heikki/test1.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Simple script (and config) to get pz2 to run against yaz-ztest, and +# calculate rankings. See how they differ for different queries +# +# (uses curl and xml-twig-tools) + +DIR=`cd ..; pwd` +HDIR=$DIR/heikki +CFG="$DIR/etc/heikki-test1.cfg" + +PZ="$DIR/src/pazpar2" + +PIDFILE=$HDIR/pz2.pid +YAZPIDFILE=$HDIR/yaz-ztest.pid + +yaz-ztest -p $YAZPIDFILE -l yaz-ztest.log & + + +$PZ -f $CFG -w "$DIR/etc" -l $HDIR/pz2.log -p $PIDFILE & +sleep 0.2 # make sure it has time to start +echo "Init" +curl -s "http://localhost:9017/?command=init" > init.out +SESSION=`xml_grep --text_only "//session" init.out ` +cat init.out +echo "Got session $SESSION" +SES="&session=$SESSION" + + +QRY="query=computer" +#SEARCH="command=search$SES&$QRY&rank=1&sort=relevance" +#SEARCH="command=search$SES&$QRY" +SEARCH="command=search$SES&$QRY&sort=relevance" +echo $SEARCH +curl -s "http://localhost:9017/?$SEARCH" > search.out +cat search.out +echo + +SHOW="command=show$SES&sort=relevance" +echo $SHOW +curl -s "http://localhost:9017/?$SHOW" > show.out +echo "md-score:" +grep "md-score" show.out +echo "relevance:" +grep "relevance" show.out +echo + +echo "All done" +kill `cat $PIDFILE` +kill `cat $YAZPIDFILE` \ No newline at end of file -- 1.7.10.4