Colin Campbell and Frédéric Demians mentioned in 2015 that Zebra facets don't work with YAZ 5.8.1: https://lists.katipo.co.nz/public/koha/2015-February/041987.html In 2016, Zeno said he couldn't get zebra::snippet to work: http://koha.1045719.n5.nabble.com/Zebra-the-elements-zebra-snippet-doesn-t-work-td5871444.html I've looked at Indexdata's YAZ git repo for 5.8.1: https://github.com/indexdata/yaz/blame/v5.8.1/src/retrieval.c And I think the problem is this commit: https://github.com/indexdata/yaz/commit/f24766f1e9fc5404fc0b512af8607d7f7054f4be At first, I thought the problem was with yaz_match_glob, but I've tested this function independently, and I think it's OK. I think the problem might be with how "el_best" is getting set. In theory, <retrieval syntax="xml"/> should be selected as el_best first... then zebra::* should be selected as it should have a true value returned from yaz_match_glob. (Note that "return 0" appears to indicate success for yaz_retrieval_request.) So if you try to use facets with YAZ 5.8.1, you get the following from Zebra: [25] Specified element set name not valid for specified database -- v2 addinfo ''. That makes it seem like el_best isn't being set at all... but I don't know. I'm going to email Indexdata and see what they come up with for this one. But in any case... I have a solution for now. If we remove the line <retrieval syntax="xml" name="zebra::*" /> and restart Zebra, we can get results using zebra::facet and zebra::snippet. I've tested this change with OpenSuse Leap 42.2 with Zebra 2.0.60 and YAZ 5.8.1, and it works, but I'd be interested in hearing about other people's experiences with older (and newer) versions of YAZ. With commit 67abcc64, Marcel actually removed most unnecessary retrieval elements, but Tomas added them back with ca074c92 along with the zebra::* line.
I've sent emails to Adam Dickmeiss and info@indexdata.com, so hopefully IndexData can shine some light on this one. In the meantime, I think a configuration change would be acceptable.
Created attachment 58718 [details] [review] Bug 17871 - Can't retrieve facets (or zebra::snippet) from Zebra with YAZ 5.8.1 Remove line <retrieval syntax="xml" name="zebra::*" />, which causes retrieval failures for zebra::* elements when using YAZ 5.8.1.
I've received a reply from Adam at IndexData, and he's included a fix in YAZ 5.20.0: --- 5.20.0 2017/01/10 yaz-url: ignore content-length for HTTP method HEAD YAZ-878 retrieval: fix incorrect backend schema YAZ-877. Should fix https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17871 record_conv: allow HTTP method to be set for authority lookup
Here's the contents of the email that Adam sent me: Hi David, we've looked at this and it should be fixed as part of YAZ [5.20.0] which will be released shortly. For a configuration like this: <retrieval syntax="xml" name="zebra::*"/> and using elem zebra::snippet the backend_schema i set to the name attribute zebra::* . The expected result is that the backend schema is set to the used element set zebra::snippet (Zebra issues error when getting zebra::*, but supports zebra::snippet). For YAZ 5.8.0 and earlier, the first rule was matched .. For YAZ 5.8.1 the 2nd rule is matched when using zebra::snippet. So to some extend this error was hidden by the first rule, but the bug has probably always been there. <retrieval syntax="xml"/> <retrieval syntax="xml" name="zebra::*"/> -- So in 5.8.0, the second rule wasn't being used anyway, so I think we're safe to remove it.
Adam from Indexdata has confirmed via email that we only need the <retrieval syntax="xml"/> line and that it will work with all YAZ versions. So there should be no barriers to removing <retrieval syntax="xml" name="zebra::*"/>.
Found the original email I wrote about this last year: http://www.mail-archive.com/koha-devel@lists.koha-community.org/msg08132.html
_TEST PLAN_ #NOTE: You won't be able to test this using a Gitifid Koha, since it's an update to Zebra files. If you're using a Gitifid Koha, you'll have to apply the patch manually. 0) Install YAZ with a version >= 5.8.1 and < 5.20.0*. 1) Build Koha from source using "make" 2) Ensure that Zebra facets are turned on in koha-conf.xml 3) Try to search in the OPAC, and note that no facets appear 4) Apply th patch 5) Build Koha from source using "Make" 6) Try to search in the OPAC, and note that facets now appear *If you're using Indexdata's Debian repository, you'll need to pin the package so that you don't install the 5.20.0 where the software bug in YAZ itself is actually fixed, since we're testing configuration as a fix here.
Created attachment 59400 [details] [review] Signed off patch Signed off - tested patch worked both against versions of yaz exhibiting the bug and an older release which did not exhibit it both provided facets with the config change in place
Update status to Signed Off
You're a champion, Colin! Thanks!
Created attachment 59495 [details] [review] Bug 17871: Remove zebra::snippet to allow access to facets in YAZ 5.8.1+ This patch restores access to zebra facets (or zebra::snippet) with YAZ 5.8.1 or higher. It was failing due to The <retrieval syntax="xml" name="zebra::*" /> entry in retrieval-info-bib-dom.xml which IndexData said it wasn't even needed to get that access. Edit: I amended the commit message (tcohen) Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> I tested on kohadevbox and found no regression or behaviour change. I will provide a followup for the packages.
Created attachment 59496 [details] [review] Bug 17871: (followup) Remove zebra::* from the packages templates Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 17.05, thanks David, Tomas!
These patches have been pushed to 16.11.x and will be in 16.11.04.
Pushed to 3.22.x for 3.22.17
Pushed to 16.05.x, for 16.05.10 release