The only "number" that is indexed in authority records is 001, which is Koha's auth_id. This makes it difficult to add matching rules to import new records since Koha replaces the record's actual control number with its own. I propose to add 035$a as Other-control-number index for authority records. This would help do matching checks when importing authority records.
Created attachment 155152 [details] [review] Bug 34693: Add 035$a as Other-control-number index in default authorities search indexes This patch adds a new index for authorities, Other-control-number, and maps it to 035$a. This will help when trying to match authority records when importing external records. Test 1: 0. Make sure Elasticsearch is set as the search engine 1. Apply patch and restart 2. Import the attached record 2.1. Go to Cataloging > Stage records for import 2.2. Choose the file 2.3. Click Upload file 2.4. Choose Record type: Authority 2.5. Click Stage for import (wait until the job is finished...) 2.6. Click View batch 2.7. Click Import this batch into the catalog (wait until the job is finished...) 2.8. Click Manage imported batch 2.9. Click View next to the record 2.10. Note the auth id number 3. Examine the ES entry for the record (replace INDEX_NAME with the index name (found in koha-conf.xml and XX with the auth_id) curl -XGET 'http://localhost:9200/INDEX_NAME_authorities/data/XX?_source_includes=other-control-number&pretty' --> It should give you the value of 035$a Test 2 (optional): 1. Steps 1 and 2 as above 2. Add a matching rule to match on 035$a for authority records 2.1. Go to Administration > Record matching rules 2.2. Click New record matching rule 2.3. Fill out the form - Matching rule code: enter a code (for example AUTCONTROL) - Description: enter a description (for example 035$a for authorities) - Match threshold: 100 - Record type: Authority record - Search index: Other-control-number - Score: 100 - Tag: 035 - Subfields: a 2.4. Click Save 3. Import the same record again, checking for matches using the new rule 3.1. Go to Cataloging > Stage records for import 3.2. Choose the file 3.3. Click Upload file 3.4. Choose Record type: Authority 3.5. Choose Record matching rule: rule created above 2.6. Click Stage for import (wait until the job is finished...) --> It should say that 1 record was found using the rule
I wrote in the release notes that for existing installations, we have to reset mappings. I'm sure it's true for existing records, but I'm not sure for records added after the upgrade. If the mappings are not reset, I'm not sure what it does. Does the new mapping just stay in limbo?
Created attachment 162795 [details] [review] Bug 34693: Add 035$a as Other-control-number index in default authorities search indexes This patch adds a new index for authorities, Other-control-number, and maps it to 035$a. This will help when trying to match authority records when importing external records. Test 1: 0. Make sure Elasticsearch is set as the search engine 1. Apply patch and restart 2. Import the attached record 2.1. Go to Cataloging > Stage records for import 2.2. Choose the file 2.3. Click Upload file 2.4. Choose Record type: Authority 2.5. Click Stage for import (wait until the job is finished...) 2.6. Click View batch 2.7. Click Import this batch into the catalog (wait until the job is finished...) 2.8. Click Manage imported batch 2.9. Click View next to the record 2.10. Note the auth id number 3. Examine the ES entry for the record (replace INDEX_NAME with the index name (found in koha-conf.xml and XX with the auth_id) curl -XGET 'http://localhost:9200/INDEX_NAME_authorities/data/XX?_source_includes=other-control-number&pretty' --> It should give you the value of 035$a Test 2 (optional): 1. Steps 1 and 2 as above 2. Add a matching rule to match on 035$a for authority records 2.1. Go to Administration > Record matching rules 2.2. Click New record matching rule 2.3. Fill out the form - Matching rule code: enter a code (for example AUTCONTROL) - Description: enter a description (for example 035$a for authorities) - Match threshold: 100 - Record type: Authority record - Search index: Other-control-number - Score: 100 - Tag: 035 - Subfields: a 2.4. Click Save 3. Import the same record again, checking for matches using the new rule 3.1. Go to Cataloging > Stage records for import 3.2. Choose the file 3.3. Click Upload file 3.4. Choose Record type: Authority 3.5. Choose Record matching rule: rule created above 2.6. Click Stage for import (wait until the job is finished...) --> It should say that 1 record was found using the rule Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Grabbing this simple one out of the QA queue.
Pushed for 24.05! Well done everyone, thank you!
Not backported to 23.11.x