Bug 40368 - Predictive patron search does not handle very similar first and last names
Summary: Predictive patron search does not handle very similar first and last names
Status: REOPENED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-14 19:48 UTC by Kristi Krueger
Modified: 2025-08-06 14:31 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristi Krueger 2025-07-14 19:48:20 UTC
When using predictive patron search, patrons that have similar first and last names do not get predicted or appear at the top of the search results. 

To recreate: Create a handful of patrons with the last name Johnson. Create a patron named John Johnson. 

Search for Johnson, John. You will notice the patron does not appear in predictive search, it will not redirect to that patron's account page, and their name/entry will not appear in the top of the search results. 

This makes it difficult to find these patrons.
Comment 1 Andrew Fuerste-Henry 2025-08-06 14:02:00 UTC

*** This bug has been marked as a duplicate of bug 36226 ***
Comment 2 Andrew Fuerste-Henry 2025-08-06 14:31:55 UTC
I've immediately flip-flopped on this. On the one hand, this issue is very related to bug 36226 and only becomes noticeable when one has a lot of patrons. But on the other hand the specific issue Kristi describes is also one of how searches are parsed.

A search for "johnson, john" is treated just like a search for "johnson john." In both cases, Koha will return every patron with "johnson" in either the firstname the surname and "john" in either the firstname or the surname. The way this search is performed, every name that contains "johnson" also contains "john."

We could address this issue by allowing a search that somehow specifies which terms and firstname and which terms are surname. That could be separate search fields or a documented special search syntax -- like "johnson, john" could be parsed as "surname: johnson, firstname: john"