Bug 27198 - Sync marc21-retrieval-info-auth-dom.xml with retrieval-info-auth-dom.xml
Summary: Sync marc21-retrieval-info-auth-dom.xml with retrieval-info-auth-dom.xml
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Zebra (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: David Cook
QA Contact:
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2020-12-11 04:23 UTC by David Cook
Modified: 2024-03-22 09:08 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the syntax in marc21-retrieval-info-auth-dom.xml, so that one can use the Zebra special retrieval elements documented at https://software.indexdata.com/zebra/doc/special-retrieval.html These are very useful when troubleshooting issues with authority records in Zebra.
Version(s) released in:


Attachments
Bug 27198: Fix syntax in marc21-retrieval-info-auth-dom.xml (1.16 KB, patch)
2020-12-11 04:44 UTC, David Cook
Details | Diff | Splinter Review
Bug 27198: Fix syntax in marc21-retrieval-info-auth-dom.xml (1.21 KB, patch)
2024-03-22 09:01 UTC, David Nind
Details | Diff | Splinter Review
Bug 27198: Fix syntax in marc21-retrieval-info-auth-dom.xml (2.20 KB, patch)
2024-03-22 09:05 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2020-12-11 04:23:37 UTC
./debian/templates/marc21-retrieval-info-auth-dom.xml is out-dated and should be synchronized with ./etc/zebradb/retrieval-info-auth-dom.xml 

The main issue is that the XML retrieval syntax is wrong which prevents a person from using the Zebra special retrieval elements documented at https://software.indexdata.com/zebra/doc/special-retrieval.html
Comment 1 David Cook 2020-12-11 04:42:21 UTC
Before patch:

root@kohadevbox:koha(bug27198)$ yaz-client unix:/var/run/koha/kohadev/authoritysocket
Connecting...OK.
Sent initrequest.
Connection accepted by v3 target.
ID     : 81
Name   : Zebra Information Server/GFS/YAZ
Version: 4.2.30 98864b44c654645bc16b2c54f822dc2e45a93031
Options: search present delSet triggerResourceCtrl scan sort extendedServices namedResultSets
Elapsed: 0.000754
Z> base authorities
Z> format xml
Z> elements zebra::snippet
Z> find e
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 21, setno 1
SearchResult-1: term=e cnt=21
records returned: 0
Elapsed: 0.002167
Z> show 1
Sent presentRequest (1+1).
Diagnostic message(s) from database:
    [25] Specified element set name not valid for specified database -- v2 addinfo 'zebra::snippet'
nextResultSetPosition = 2
Elapsed: 0.000218
Z> exit
See you later, alligator.

After patch:

root@kohadevbox:koha(bug27198)$ yaz-client unix:/var/run/koha/kohadev/authoritysocket
Connecting...OK.
Sent initrequest.
Connection accepted by v3 target.
ID     : 81
Name   : Zebra Information Server/GFS/YAZ
Version: 4.2.30 98864b44c654645bc16b2c54f822dc2e45a93031
Options: search present delSet triggerResourceCtrl scan sort extendedServices namedResultSets
Elapsed: 0.000840
Z> base authorities
Z> format xml
Z> elements zebra::snippet
Z> find e
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 21, setno 1
SearchResult-1: term=e cnt=21
records returned: 0
Elapsed: 0.002212
Z> show 1
Sent presentRequest (1+1).
Records: 1
Record type: XML
<record xmlns="http://www.indexdata.com/zebra/">
  <snippet name="Any" type="w">Gontarski, S. <s>E</s></snippet>
</record>nextResultSetPosition = 2
Elapsed: 0.013929
Comment 2 David Cook 2020-12-11 04:44:31 UTC
Created attachment 114319 [details] [review]
Bug 27198: Fix syntax in marc21-retrieval-info-auth-dom.xml

This patch fixes the syntax in marc21-retrieval-info-auth-dom.xml,
so that one can use the Zebra special retrieval elements documented
at https://software.indexdata.com/zebra/doc/special-retrieval.html

These are very useful when troubleshooting issues with authority
records in Zebra.
Comment 3 David Cook 2020-12-23 03:55:24 UTC
Listing this one as Academy as it's pretty straight-forward. Happy to help people with this one too.
Comment 4 Victoria Faafia 2021-01-18 23:23:53 UTC
Can you please provide a test plan?
Comment 5 David Cook 2021-01-18 23:43:23 UTC
(In reply to Victoria Faafia from comment #4)
> Can you please provide a test plan?

Ooops I forgot to label it but you should be able to use Comment 1 (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27198#c1) as a test plan.
Comment 6 Eden 2021-01-19 22:06:57 UTC
Followed the test plan but an error kept recurring even after applying patch. Is there a step missing such as rebuilding zebra etc?
Comment 7 David Cook 2021-01-22 01:28:09 UTC
(In reply to Eden from comment #6)
> Followed the test plan but an error kept recurring even after applying
> patch. Is there a step missing such as rebuilding zebra etc?

Ah, yes. My mistake! Not rebuilding Zebra, but restarting Zebra for sure. 

- koha-zebra --stop kohadev
- pkill zebrasrv
- koha-zebra --start kohadev

That should do the trick.

The pkill zebrasrv is there because koha-zebra --stop kohadev won't work if the zebrasrv process has forked child processes.
Comment 8 David Nind 2021-06-06 22:26:50 UTC
Hi David.

I had a go at testing.

Test plan:
1. yaz-client unix:/var/run/koha/kohadev/authoritysocket
2. Enter these commands (see comment #1):
   . base authorities
   . format xml
   . elements zebra::snippet
   . find e
   . show 1
3. Result = diagnostic message:
     Diagnostic message(s) from database:
        [25] Specified element set name not valid for specified database -- v2 addinfo 'zebra::snippet'
4. Apply the patch
5. Stop and restart zebra (no need to rebuild the Zebra index):
   . koha-zebra --stop kohadev
   . pkill zebrasrv
   . koha-zebra --start kohadev
6. Repeat commands in step 2.
7. Result from show 1 = XML output:
    Sent presentRequest (1+1).
    Records: 1
    Record type: XML
    <record xmlns="http://www.indexdata.com/zebra/">
      <snippet name="Any" type="w">Gontarski, S. <s>E</s></snippet>
    </record>nextResultSetPosition = 2
   Elapsed: 0.013929

I still get the results as per step 3.

The only thing I noticed is that the version information is different when you connect - 2.0.59 instead of 4.2.30:
  root@kohadevbox:koha(bz27198)$ yaz-client unix:/var/run/koha/kohadev/authoritysocket
  Connecting...OK.
  Sent initrequest.
  Connection accepted by v3 target.
  ID     : 81
  Name   : Zebra Information Server/GFS/YAZ
  Version: 2.0.59/5.27.1 872b6f92a024bb53bc1c11dfeccd47f065f98238
  Options: search present delSet triggerResourceCtrl scan sort extendedServices namedResultSets
  Elapsed: 0.002171
  Z> 

I am using koha-testing-docker.

David
Comment 9 David Cook 2021-06-07 02:36:50 UTC
Hmm interesting. Happy for you to mark this as Failed QA. 

I'm probably not going to review it any time soon, to be honest.
Comment 10 David Cook 2024-03-19 22:08:45 UTC
Oh man... looking back on this and it's so obvious what I was missing in the test plan. I made the assumption that the tester had copied the file.

After applying the patch, you'll need to do the following:
cp debian/templates/marc21-retrieval-info-auth-dom.xml /etc/koha/marc21-retrieval-info-auth-dom.xml
Comment 11 David Nind 2024-03-22 09:01:33 UTC Comment hidden (obsolete)
Comment 12 David Nind 2024-03-22 09:05:10 UTC
Created attachment 163665 [details] [review]
Bug 27198: Fix syntax in marc21-retrieval-info-auth-dom.xml

This patch fixes the syntax in marc21-retrieval-info-auth-dom.xml,
so that one can use the Zebra special retrieval elements documented
at https://software.indexdata.com/zebra/doc/special-retrieval.html

These are very useful when troubleshooting issues with authority
records in Zebra.

Test plan (using KTD):
1. yaz-client unix:/var/run/koha/kohadev/authoritysocket
2. Enter these commands:
   . base authorities
   . format xml
   . elements zebra::snippet
   . find e
   . show 1
3. Result = diagnostic message:
     Diagnostic message(s) from database:
        [25] Specified element set name not valid for specified database
             -- v2 addinfo 'zebra::snippet'
4. Apply the patch
5. Copy updated file: sudo cp debian/templates/marc21-retrieval-info-auth-dom.xml
   /etc/koha/marc21-retrieval-info-auth-dom.xml
6. Stop and restart zebra (no need to rebuild the Zebra index):
   . sudo koha-zebra --stop kohadev
   . sudo pkill zebrasrv
   . sudo koha-zebra --start kohadev
7. Repeat commands in step 2.
8. Result from show 1 = XML output:
    Sent presentRequest (1+1).
    Records: 1
    Record type: XML
    <record xmlns="http://www.indexdata.com/zebra/">
      <snippet name="Any" type="w">Gontarski, S. <s>E</s></snippet>
    </record>nextResultSetPosition = 2
   Elapsed: 0.013929

Signed-off-by: David Nind <david@davidnind.com>
Comment 13 David Nind 2024-03-22 09:08:27 UTC
I have:

1. Amended the patch to include the test plan
2. Changed the assignee