beginnings of a small script
authorHeikki Levanto <heikki@indexdata.dk>
Wed, 20 Nov 2013 14:52:29 +0000 (15:52 +0100)
committerHeikki Levanto <heikki@indexdata.dk>
Wed, 20 Nov 2013 14:52:29 +0000 (15:52 +0100)
HEIKKI-TODO [deleted file]
heikki/README-HEIKKI [new file with mode: 0644]
heikki/test1.cfg [new file with mode: 0644]
heikki/test1.sh [new file with mode: 0755]

diff --git a/HEIKKI-TODO b/HEIKKI-TODO
deleted file mode 100644 (file)
index c557486..0000000
+++ /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 (file)
index 0000000..238a7b2
--- /dev/null
@@ -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 (file)
index 0000000..129d2aa
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
+  
+  <server>
+    <listen port="9004"/>
+    <include src="default.xml"/>
+  </server>
+  
+</pazpar2>
+
+<!-- Keep this comment at the end of the file
+     Local variables:
+     mode: nxml
+     End:
+-->
+
diff --git a/heikki/test1.sh b/heikki/test1.sh
new file mode 100755 (executable)
index 0000000..14032e9
--- /dev/null
@@ -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