[Koha-bugs] [Bug 32772] Patron autocomplete should not use contains on all fields

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 31 21:28:37 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32772

--- Comment #3 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 145914
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145914&action=edit
Bug 32772: [Alternate] Add support for '^' as "Starts with" in patron searching

This patch parses each term we send to patron search - if it finds it starts
with '^' then the
term is searched as a starts with - other terms will still be 'contains'

To test:
1 - Make a bunch of williams and fitzwiliams
    UPDATE borrowers SET surname = 'Fitzwilliams' IF borrowernumber < 25;
    UPDATE borrowers SET surname = 'Williams' IF borrowernumber > 25;
2 - Enable PatronAutrocomplete syspref
3 - Search for 'Will' in patron search
4 - You get Fitzwilliams (you see them in the automplete too)
5 - Apply patch
6 - Search for '^Will'
7 - Confirm that autocomplete and full search results only have williams, not
fitzwilliams
8 - Search for '^Will an'
9 - Confirm you get 'Frances Williams' and 'Annie Williams'  - as the 'an' is
searched as contains

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list