Summary: | Matchpoints with multiple fields require all fields to match under Elasticsearch | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Searching - Elasticsearch | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | Pushed to main --- | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | normal | ||
Priority: | P5 - low | CC: | dcook, magnus, martin.renvoize, pascal.uphaus |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
25.05.00
|
Circulation function: | |
Attachments: |
Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat
Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat |
Description
Nick Clemens (kidclamp)
2025-02-10 17:04:41 UTC
Created attachment 177706 [details] [review] Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat When building queries for matchign Zebra uses OR to combine searches - Elasticsearch has been effectively using 'AND' - this patch checks whether and_or has been passed and follows the variable when present. To test: 1 - Have an import file of auths with multiple 035 2 - Setup an authority matching rule Search index: other-control-number Score: 1000 Tag: 035 Subfields: a 3 - Make sure Koha is using Elasticsearch 4 - Stage file without matching, import file 5 - Stage file again, using your matching rule 6 - Note all records match 7 - Setup Cataloging->Marc modification template 8 - Add an action to delete first 035 field 9 - Run it against the records you just imported You can use a report: SELECT authid FROM auth_header WHERE authid > #### (find the lowest new record number in batch you imported) 10 - Change matching rule in batch to none, then back to your rule 11 - No matches! 12 - Apply patch, restart all 13 - Set matchign rule to none, then back to your rule 14 - Matches! $ git bz apply 39079 Bug 39079 - Matchpoints with multiple fields require all fields to match under Elasticsearch 177706 - Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat error: sha1 information is lacking or useless (Koha/SearchEngine/Elasticsearch/QueryBuilder.pm). error: could not build fake ancestor Patch failed at 0001 Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-39079-Follow-andor-variable-when-passed-to-bui-W7J4WR.patch Created attachment 180108 [details] [review] Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat When building queries for matchign Zebra uses OR to combine searches - Elasticsearch has been effectively using 'AND' - this patch checks whether and_or has been passed and follows the variable when present. To test: 1 - Have an import file of auths with multiple 035 2 - Setup an authority matching rule Search index: other-control-number Score: 1000 Tag: 035 Subfields: a 3 - Make sure Koha is using Elasticsearch 4 - Stage file without matching, import file 5 - Stage file again, using your matching rule 6 - Note all records match 7 - Setup Cataloging->Marc modification template 8 - Add an action to delete first 035 field 9 - Run it against the records you just imported You can use a report: SELECT authid FROM auth_header WHERE authid > #### (find the lowest new record number in batch you imported) 10 - Change matching rule in batch to none, then back to your rule 11 - No matches! 12 - Apply patch, restart all 13 - Set matchign rule to none, then back to your rule 14 - Matches! Created attachment 180151 [details] [review] Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat When building queries for matchign Zebra uses OR to combine searches - Elasticsearch has been effectively using 'AND' - this patch checks whether and_or has been passed and follows the variable when present. To test: 1 - Have an import file of auths with multiple 035 2 - Setup an authority matching rule Search index: other-control-number Score: 1000 Tag: 035 Subfields: a 3 - Make sure Koha is using Elasticsearch 4 - Stage file without matching, import file 5 - Stage file again, using your matching rule 6 - Note all records match 7 - Setup Cataloging->Marc modification template 8 - Add an action to delete first 035 field 9 - Run it against the records you just imported You can use a report: SELECT authid FROM auth_header WHERE authid > #### (find the lowest new record number in batch you imported) 10 - Change matching rule in batch to none, then back to your rule 11 - No matches! 12 - Apply patch, restart all 13 - Set matchign rule to none, then back to your rule 14 - Matches! Signed-off-by: Magnus Enger <magnus@libriotech.no> Works as advertised! Created attachment 182263 [details] [review] Bug 39079: Follow 'and_or' variable when passed to build_auth_query_compat When building queries for matchign Zebra uses OR to combine searches - Elasticsearch has been effectively using 'AND' - this patch checks whether and_or has been passed and follows the variable when present. To test: 1 - Have an import file of auths with multiple 035 2 - Setup an authority matching rule Search index: other-control-number Score: 1000 Tag: 035 Subfields: a 3 - Make sure Koha is using Elasticsearch 4 - Stage file without matching, import file 5 - Stage file again, using your matching rule 6 - Note all records match 7 - Setup Cataloging->Marc modification template 8 - Add an action to delete first 035 field 9 - Run it against the records you just imported You can use a report: SELECT authid FROM auth_header WHERE authid > #### (find the lowest new record number in batch you imported) 10 - Change matching rule in batch to none, then back to your rule 11 - No matches! 12 - Apply patch, restart all 13 - Set matchign rule to none, then back to your rule 14 - Matches! Signed-off-by: Magnus Enger <magnus@libriotech.no> Works as advertised! Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Makes sense, follows Zebra precedent. Passing QA Pushed for 25.05! Well done everyone, thank you! |