From: Dennis Schafroth Date: Tue, 1 Nov 2011 13:00:40 +0000 (+0100) Subject: Merge branch 'spell-check' X-Git-Tag: v1.6.5~1 X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=commitdiff_plain;h=acf3792f588c9195fbcbba66802ac1e3f078c16c;hp=5d93981df5d0301c2e8b6849814e838ada693141;p=pazpar2-moved-to-github.git Merge branch 'spell-check' --- diff --git a/NEWS b/NEWS index 85a09f4..d818d3f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +--- 1.6.5 2011/11/01 +Updated bytarget command to contain a suggestions element with misspelled +words and suggestions to these. pz2.js has been updated to deliver this +onwards as well. Only target that currently delivers this is the solr +client in YAZ 4.2.18. + --- 1.6.4 2011/10/28 New service definition element, xslt, that allows an embedded stylesheet diff --git a/configure.ac b/configure.ac index 0155115..2580281 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ # Autoconf and automake setup AC_PREREQ(2.60) -AC_INIT([pazpar2],[1.6.4],[pazpar2-help@indexdata.dk]) +AC_INIT([pazpar2],[1.6.5],[pazpar2-help@indexdata.dk]) AC_CONFIG_HEADERS(src/config.h) @@ -22,7 +22,7 @@ AC_LANG(C) AC_C_INLINE -YAZ_INIT([static icu],[4.2.17]) +YAZ_INIT([static icu],[4.2.18]) if test -z "$YAZLIB"; then AC_MSG_ERROR([YAZ development libraries missing]) fi diff --git a/debian/control b/debian/control index 1e8ef4a..21e3fd7 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: extra Maintainer: Adam Dickmeiss Build-Depends: debhelper (>= 5), autotools-dev, - libyaz4-dev (>= 4.2.17), + libyaz4-dev (>= 4.2.18), docbook-xsl, libgnutls-dev Standards-Version: 3.7.2 diff --git a/pazpar2.spec b/pazpar2.spec index 580d410..e65dc44 100644 --- a/pazpar2.spec +++ b/pazpar2.spec @@ -1,17 +1,17 @@ Summary: Metasearcher Name: pazpar2 -Version: 1.6.4 +Version: 1.6.5 Release: 1indexdata License: GPL Group: Applications/Internet Vendor: Index Data ApS Source: pazpar2-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root -BuildRequires: libyaz4-devel >= 4.2.17 +BuildRequires: libyaz4-devel >= 4.2.18 Packager: Adam Dickmeiss URL: http://www.indexdata.com/pazpar2 Summary: pazpar2 daemon -Requires: libyaz4 >= 4.2.17 +Requires: libyaz4 >= 4.2.18 %description Pazpar2 is a high-performance, user interface-independent, data diff --git a/src/http_command.c b/src/http_command.c index 587c908..a86aabb 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -642,8 +642,11 @@ static void cmd_bytarget(struct http_channel *c) wrbuf_puts(c->wrbuf, ht[i].settings_xml); wrbuf_puts(c->wrbuf, "\n"); } - if (ht[i].suggestions_xml) + if (ht[i].suggestions_xml && ht[i].suggestions_xml[0]) { + wrbuf_puts(c->wrbuf, ""); wrbuf_puts(c->wrbuf, ht[i].suggestions_xml); + wrbuf_puts(c->wrbuf, ""); + } wrbuf_puts(c->wrbuf, ""); } response_close(c, "bytarget"); diff --git a/test/test_solr_spell.cfg b/test/test_solr_spell.cfg new file mode 100644 index 0000000..1c30567 --- /dev/null +++ b/test/test_solr_spell.cfg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/test_solr_spell.sh b/test/test_solr_spell.sh new file mode 100755 index 0000000..6f2961f --- /dev/null +++ b/test/test_solr_spell.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# srcdir might be set by make +srcdir=${srcdir:-"."} + +#TODO set up solr target. For now use donut +#F=../solr/client.sh +# +#rm -f solr.pid +#$F -l solr.log -p ztest.pid -D @:9999 +#sleep 1 +#if test ! -f ztest.pid; then +# echo "yaz-ztest could not be started" +# exit 0 +#fi + +${srcdir}/run_pazpar2.sh test_solr_spell +E=$? + +#kill `cat ztest.pid` +#rm ztest.pid +exit $E + +# Local Variables: +# mode:shell-script +# sh-indentation: 2 +# sh-basic-offset: 4 +# End: diff --git a/test/test_solr_spell.urls b/test/test_solr_spell.urls new file mode 100644 index 0000000..0a42801 --- /dev/null +++ b/test/test_solr_spell.urls @@ -0,0 +1,6 @@ +http://localhost:9763/search.pz2?command=init&clear=1 +http://localhost:9763/search.pz2?session=1&command=settings&pz%3Atermlist_term_count%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=10&use_url_proxy%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=0&pz%3Apiggyback%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1&pz%3Apreferred%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1&pz%3Acclmap%3Asu%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dsubject&pz%3Asru%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=solr&use_thumbnails%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=0&pz%3Acclmap%3Adate%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Ddate&medium%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=web&pz%3Aname%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=ocs_test&pz%3Acclmap%3Aissn%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=u%3D8&pz%3Acclmap%3Ati%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dtitle&pz%3Acclmap%3Aau%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dauthor&pz%3Axslt%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=solr-pz2.xsl&pz%3Acclmap%3Aterm%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dtext+s%3Dal&pz%3Acclmap%3Aisbn%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Disbn&pz%3Aqueryencoding%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=UTF-8&pz%3Aextra_args%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=spellcheck=true +http://localhost:9763/search.pz2?session=1&command=search&query=kingg +2 http://localhost:9763/search.pz2?session=1&command=show&block=preferred +http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Csubject%2Cauthor%2Cdate%2Cmedium +http://localhost:9763/search.pz2?session=1&command=bytarget diff --git a/test/test_solr_spell_1.res b/test/test_solr_spell_1.res new file mode 100644 index 0000000..81ff9ff --- /dev/null +++ b/test/test_solr_spell_1.res @@ -0,0 +1,2 @@ + +OK11 \ No newline at end of file diff --git a/test/test_solr_spell_2.res b/test/test_solr_spell_2.res new file mode 100644 index 0000000..42534e3 --- /dev/null +++ b/test/test_solr_spell_2.res @@ -0,0 +1,2 @@ + +OK \ No newline at end of file diff --git a/test/test_solr_spell_3.res b/test/test_solr_spell_3.res new file mode 100644 index 0000000..ab63fe6 --- /dev/null +++ b/test/test_solr_spell_3.res @@ -0,0 +1,2 @@ + +OK \ No newline at end of file diff --git a/test/test_solr_spell_4.res b/test/test_solr_spell_4.res new file mode 100644 index 0000000..5a1147b --- /dev/null +++ b/test/test_solr_spell_4.res @@ -0,0 +1,8 @@ + +OK +0 +0 +0 +0 +0 + \ No newline at end of file diff --git a/test/test_solr_spell_5.res b/test/test_solr_spell_5.res new file mode 100644 index 0000000..848b25c --- /dev/null +++ b/test/test_solr_spell_5.res @@ -0,0 +1,13 @@ + +0 + + + + + + + + + + + \ No newline at end of file diff --git a/test/test_solr_spell_6.res b/test/test_solr_spell_6.res new file mode 100644 index 0000000..abf47c8 --- /dev/null +++ b/test/test_solr_spell_6.res @@ -0,0 +1,16 @@ + +OK +ocs-test.indexdata.com/solr/select +ocs_test +0 +0 +0 +Client_Idle + +king +kinga +kingp +lingg +kingv + + \ No newline at end of file