Bug 36312 - Authorities Z39.50 missing Subject-heading 21
Summary: Authorities Z39.50 missing Subject-heading 21
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-14 05:44 UTC by David Cook
Modified: 2024-04-01 23:21 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 36312: Add Subject-heading 1=21 to Zebra authorities indexing (4.83 KB, patch)
2024-03-14 06:11 UTC, David Cook
Details | Diff | Splinter Review
Bug 36312: Add Subject-heading 1=21 to Zebra authorities indexing (4.87 KB, patch)
2024-03-23 07:47 UTC, David Nind
Details | Diff | Splinter Review
Bug 36312: Add Subject-heading 1=21 to Zebra authorities indexing (4.93 KB, patch)
2024-04-01 10:53 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2024-03-14 05:44:00 UTC
If you do a 1=21 (ie Subject-heading) Z39.50 search against Koha's authority database, you won't get a result.

There's a few reasons for this.

If using Zebra:
- /etc/koha/zebradb/authorities/etc/bib1.att is missing a line like “att 21    Subject-heading”
- /etc/koha/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl isn’t indexing the 150 field into the “Subject-heading” index

If using z3950_responder.pl with Elastic, ./etc/z3950/attribute_mappings.yaml doesn't have an appropriate mapping. At a glance, I don't see a subject specific index for subject authorities either in ./admin/searchengine/elasticsearch/mappings.yaml

If using z3950_responder.pl with Zebra, then it's the same problem as if you were just using Zebra.

--

At the moment, I'm concerned with Zebra, but I'll want to look at Elastic at some point...
Comment 1 David Cook 2024-03-14 06:11:55 UTC
Created attachment 163130 [details] [review]
Bug 36312: Add Subject-heading 1=21 to Zebra authorities indexing

This change adds the 1=21 Subject-heading index to Zebra authorities.

Test plan:
0. Apply patch
1. sudo cp etc/zebradb/authorities/etc/bib1.att /etc/koha/zebradb/authorities/etc/bib1.att
2. sudo cp etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl \
    /etc/koha/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl
3. sudo koha-indexer --stop kohadev
4. sudo koha-zebra --stop kohadev
5. sudo koha-zebra --start kohadev
6. sudo koha-indexer --start kohadev
7. sudo koha-rebuild-zebra -f -a -v kohadev
8. yaz-client unix:/var/run/koha/kohadev/authoritysocket
9. base authorities
10. find @attr 1=21 "Philosophy, Marxist"
11. Zebra returns a hit
12. Celebrate!
Comment 2 David Cook 2024-03-14 06:13:11 UTC
Note that this is essential if:
1. You're running Koha as a MARC Authorities Z39.50 target
2. You're searching the above target using Koha's Z39.50 authority search to search for "Subject heading"
Comment 3 David Nind 2024-03-23 07:47:57 UTC
Created attachment 163753 [details] [review]
Bug 36312: Add Subject-heading 1=21 to Zebra authorities indexing

This change adds the 1=21 Subject-heading index to Zebra authorities.

Test plan:
0. Apply patch
1. sudo cp etc/zebradb/authorities/etc/bib1.att /etc/koha/zebradb/authorities/etc/bib1.att
2. sudo cp etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl \
    /etc/koha/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl
3. sudo koha-indexer --stop kohadev
4. sudo koha-zebra --stop kohadev
5. sudo koha-zebra --start kohadev
6. sudo koha-indexer --start kohadev
7. sudo koha-rebuild-zebra -f -a -v kohadev
8. yaz-client unix:/var/run/koha/kohadev/authoritysocket
9. base authorities
10. find @attr 1=21 "Philosophy, Marxist"
11. Zebra returns a hit
12. Celebrate!

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Nick Clemens (kidclamp) 2024-04-01 10:53:11 UTC
Created attachment 164176 [details] [review]
Bug 36312: Add Subject-heading 1=21 to Zebra authorities indexing

This change adds the 1=21 Subject-heading index to Zebra authorities.

Test plan:
0. Apply patch
1. sudo cp etc/zebradb/authorities/etc/bib1.att /etc/koha/zebradb/authorities/etc/bib1.att
2. sudo cp etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl \
    /etc/koha/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl
3. sudo koha-indexer --stop kohadev
4. sudo koha-zebra --stop kohadev
5. sudo koha-zebra --start kohadev
6. sudo koha-indexer --start kohadev
7. sudo koha-rebuild-zebra -f -a -v kohadev
8. yaz-client unix:/var/run/koha/kohadev/authoritysocket
9. base authorities
10. find @attr 1=21 "Philosophy, Marxist"
11. Zebra returns a hit
12. Celebrate!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens (kidclamp) 2024-04-01 10:56:00 UTC
This works, just one question, why not use 'Subject-topical' as the 21?

It seems to be defined for the same fields, with the exception that Subject heading is in both:
<kohaidx:index_subfields tag="150" subfields="abvxyz">
<kohaidx:index_heading tag="150" subfields="abvxyz" subdivisions="vxyz">
But I am not sure the difference between the two, or why we have both Subject-topical and Subject-topical-heading
Comment 6 David Cook 2024-04-01 23:21:26 UTC
(In reply to Nick Clemens from comment #5)
> This works, just one question, why not use 'Subject-topical' as the 21?

It's a good question.

Subject-topical is 1079, and Subject-Heading/21 should include more than just topical subjects.

But what should it include?

Maybe we should be using "Heading". 

The "Library of Congress Subjects" and "Library of Congress Names" databases seem to index any 1XX heading as "Subject-Heading", since that's what a 6XX bib entry is. 

--

Then for the Koha Z30.50 authority search points, we could update/expand where we replace "Subject heading" with "Heading (any)" and add a "Subject (topical)". Should probably actually add search points for each of the different 1XX headings.