build_auth_query_compat for ES accepts only a few marclist parameters. In Zebra we pass through any indexes that we have not mapped. ES should do the same
Created attachment 93414 [details] [review] Bug 23719: Allow searching specific fields for matching authorities in ES To test: 1 - Export your authorities via Tools->Export data 2 - Define a record matching rule in Admin->Record matchign rules Use index: LC-card-number field: 010$a 3 - Stage the exported records for import and use the rule created above for matching 4 - The process does not complete 5 - Check intranet error logs - exception on unknown marclist 6 - Apply patch 7 - Repeat 8 - Success! 9 - prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t
Created attachment 94680 [details] [review] Bug 23719: Allow searching specific fields for matching authorities in ES To test: 1 - Export your authorities via Tools->Export data 2 - Define a record matching rule in Admin->Record matchign rules Use index: LC-card-number field: 010$a 3 - Stage the exported records for import and use the rule created above for matching 4 - The process does not complete 5 - Check intranet error logs - exception on unknown marclist 6 - Apply patch 7 - Repeat 8 - Success! 9 - prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed off on behalf of Ron Houk, rhouk@ottumwapubliclibrary.org
I followed the test plan, and everything worked as it was supposed to.
The current behavior is definitely wrong. I am wondering if we should not have the error displayed somewhere, if the search field is not defined in the ES mapping. With Zebra we get: indexoAuth error: Unsupported Use attribute (114) pouet Bib-1 With ES (and this patch), we do not get anything. Easier to test this patch with: Existing search field: http://pro.kohadev.org/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=Personal-name&and_or=and&operator=contains&value=d&orderby=HeadingAsc non-existing search field: http://pro.kohadev.org/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=pouet&and_or=and&operator=contains&value=d&orderby=HeadingAsc
Created attachment 94913 [details] [review] Bug 23719: (follow-up) Add warn when passed invalid search field in marclist
Does the extra patch here resolve your worries Jonathan?
(In reply to Martin Renvoize from comment #7) > Does the extra patch here resolve your worries Jonathan? I do not think so: Unknown search field personal-name in marclist at /home/vagrant/kohaclone/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 478. http://pro.kohadev.org/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=Personal-name&and_or=and&operator=contains&value=d&orderby=HeadingAsc
Created attachment 95001 [details] [review] Bug 23719: (follow-up) Add warn when passed invalid search field in marclist Note: I also remove warnings for undefined operation in this patch, is a trivial fix To test: prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t
(In reply to Nick Clemens from comment #6) > Created attachment 94913 [details] [review] [review] > Bug 23719: (follow-up) Add warn when passed invalid search field in marclist Heh, helps if you get the order of the hashes correct.
Created attachment 95090 [details] [review] Bug 23719: Allow searching specific fields for matching authorities in ES To test: 1 - Export your authorities via Tools->Export data 2 - Define a record matching rule in Admin->Record matchign rules Use index: LC-card-number field: 010$a 3 - Stage the exported records for import and use the rule created above for matching 4 - The process does not complete 5 - Check intranet error logs - exception on unknown marclist 6 - Apply patch 7 - Repeat 8 - Success! 9 - prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 95091 [details] [review] Bug 23719: (follow-up) Add warn when passed invalid search field in marclist Note: I also remove warnings for undefined operation in this patch, is a trivial fix To test: prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nice work! Pushed to master for 19.11.00
Created attachment 99714 [details] [review] Bug 23719: [19.05.x] Allow searching specific fields for matching authorities in ES To test: 1 - Export your authorities via Tools->Export data 2 - Define a record matching rule in Admin->Record matchign rules Use index: LC-card-number field: 010$a 3 - Stage the exported records for import and use the rule created above for matching 4 - The process does not complete 5 - Check intranet error logs - exception on unknown marclist 6 - Apply patch 7 - Repeat 8 - Success! 9 - prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Bug 23719: (follow-up) Add warn when passed invalid search field in marclist Note: I also remove warnings for undefined operation in this patch, is a trivial fix To test: prove -v t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
backported to 19.05.x for 19.05.09 thanks for the rebase kidclamp!