+++ /dev/null
-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
-
-
-
--- /dev/null
+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.
--- /dev/null
+<?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:
+-->
+
--- /dev/null
+#!/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