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.