https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43147 Bug ID: 43147 Summary: Allow a match point to require two independent fields to both match (e.g. 001 and 003) Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Target Milestone: --- C4::Matcher's match points cannot express "these two independent fields must both match" as a single condition. This makes it impossible to configure a record matching rule that treats a MARC control number (001) as authoritative only in combination with its control number identifier (003), which is a common and useful matching strategy for imported records from external sources that reuse 001 values across different originating systems. Currently, adding multiple components to one match point concatenates their extracted values into a single search phrase (see _get_match_keys in C4/Matcher.pm), rather than requiring each component to match independently. This doesn't produce AND semantics even in principle, because the underlying search indexes for 001 (control-number) and 003 (control-number-identifier) are indexed as completely separate fields (see admin/searchengine/elasticsearch/mappings.yaml). A concatenated phrase search against either index alone can never correctly require both fields to match, since neither index contains both values together. Request: add a way to define a match point (or a new kind of match point) that requires two or more independent search index values to each be present on the same candidate record, rather than concatenating them into one phrase search. This would let a matching rule express "match only if 001 matches AND 003 matches", analogous to how Koha already supports "required checks" at the matcher level, but scoped to build a single match point's own pass/fail condition from multiple independently-matched fields. Test plan: 1. Create two bibliographic records where record A has 001 = "12345", 003 = "OSt", and record B has 001 = "12345", 003 = "DLC". 2. Create a record matching rule with a single match point on the control-number index (tag 001) plus a second component for the control-number-identifier index (tag 003). 3. Stage an incoming record with 001 = "12345", 003 = "DLC" for import. 4. Observe that Koha's matcher cannot be configured to match only record B (matching both 001 and 003) while correctly excluding record A (which only shares 001) -- either both records score as candidates, or neither does, because there's no way to require both fields to agree for the same candidate as a single condition. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.