[Bug 44387] New: Content type (ctype) search does not find records with several nature of contents codes
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44387 Bug ID: 44387 Summary: Content type (ctype) search does not find records with several nature of contents codes Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching Assignee: koha-bugs@lists.koha-community.org Reporter: adolfo.rodriguez@xercode.es QA Contact: testopia@bugs.koha-community.org Target Milestone: --- The content type limit of the advanced search (ctype: Bibliographies, Catalogs, Encyclopedias...) does not find records that have more than one nature of contents code. In MARC21, 008/24-27 (books) holds up to four independent one-character codes (e.g. "be " for a record that is both a bibliography and an encyclopedia). In UNIMARC the same codes are in 105$a/4-7. The ctype index is defined on the whole range: - Elasticsearch: mappings 008_/24-27 (MARC21) and 105a_/4-7 (UNIMARC) - Zebra MARC21: index_control_field 008 offset 24 length 4 so the codes are indexed as a single token. A record with "be " is only found with ctype:be, and not with ctype:b nor ctype:e, which are the values used by the advanced search limits. Records with a single code ("b ") are found, which hides the problem. Zebra UNIMARC already indexes each position separately (105$a offsets 4, 5, 6 and 7 with length 1), so it does not have the problem. This was already noted by Marcel de Rooy in bug 5295 comment 10 (2012) for Zebra. Proposed fix: index each position separately, as Zebra UNIMARC does: - Elasticsearch: replace 008_/24-27 by 008_/24, 008_/25, 008_/26 and 008_/27, and 105a_/4-7 by 105a_/4 ... 105a_/7 (mappings.yaml + database update for existing installations, only if the mapping has not been modified) - Zebra MARC21: four index_control_field entries of length 1 A full reindex is needed afterwards. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44387 --- Comment #1 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Correction to the description: Zebra is not affected. The ctype CCL qualifier uses left and right truncation (Content-type 1=1034 t=b in ccl.properties), so ctype=b already matches "be". I checked it in KTD with Zebra. The patch only changes the Elasticsearch mappings. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44387 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |adolfo.rodriguez@xercode.es |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44387 --- Comment #2 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 212989 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212989&action=edit Bug 44387: Index each nature of contents code of ctype separately in Elasticsearch The ctype index (content type limit of the advanced search) is mapped to the whole range of nature of contents codes: 008_/24-27 in MARC21 and 105a_/4-7 in UNIMARC. These positions hold up to four independent one-character codes, but Elasticsearch indexes them as a single token, so a record with "be " (bibliography and encyclopedia) is only found with ctype:be, and not with ctype:b nor ctype:e. Zebra is not affected: the ctype CCL qualifier uses left and right truncation (t=b), so ctype=b matches "be". This patch maps each position separately: 008_/24-27 is replaced by 008_/24, 008_/25, 008_/26 and 008_/27, and 105a_/4-7 by 105a_/4 to 105a_/7. A database update changes the existing mappings, only if they have not been modified. Steps to follow (Elasticsearch, MARC21): 1. Edit a book record and set 008/24-27 (Nature of contents) to "be" (Bibliographies, Encyclopedias). Edit another one and set it to "b". 2. Advanced search > Limits > Content: select "Bibliographies", search. Only the second record is found. With "Encyclopedias", none of them is found. 3. Apply the patch, run updatedatabase and note the message about the ctype mapping. 4. Administration > Search engine configuration (Elasticsearch): note that ctype is now mapped to 008_/24, 008_/25, 008_/26 and 008_/27. 5. Reindex: misc/search_tools/rebuild_elasticsearch.pl -b -d 6. Repeat 2: "Bibliographies" finds both records, "Encyclopedias" finds the first one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44387 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=5295 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org