To recreate: 0 - Be using Elasticsearch with Koha 1 - Add a new branch code:OR name:Orly 2 - Add an item to this branch 3 - Use advanced search to limit search to only Orly 4 - The search fails!
Created attachment 136412 [details] [review] Bug 31013: Quote branchcodes in Elasticsearch limits This patch adds quoting when handling branchcodes in searching in order to prevent errors when branchcodes are reserved words in ES To test: 0 - Be using Elasticsearch with Koha 1 - Add a new branch code:OR name:Orly 2 - Add an item to this branch 3 - Use advanced search to limit search to only Orly 4 - Oh really bad, the search fails! 5 - Apply patch 6 - Repeat search 7 - Oh really good, the search succeeds 8 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t
Created attachment 136419 [details] [review] Bug 31013: Quote branchcodes in Elasticsearch limits This patch adds quoting when handling branchcodes in searching in order to prevent errors when branchcodes are reserved words in ES To test: 0 - Be using Elasticsearch with Koha 1 - Add a new branch code:OR name:Orly 2 - Add an item to this branch 3 - Use advanced search to limit search to only Orly 4 - Oh really bad, the search fails! 5 - Apply patch 6 - Repeat search 7 - Oh really good, the search succeeds 8 - prove t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Trivial and clear fix with unit tests included.. going straight for QA on this one. QA scripts are happy, testing proves the fix works, Unit tests all passing and changes make sense. Passing QA
Pushed to master for 22.11. Nice work everyone, thanks!
Btw, Nick, you made me chuckle with "Orly" heh.
Backported to 22.05.x for 22.05.04
pushed to 21.11.x for 21.11.11
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document, marking resolved.