sfu-dhil / wphp

Women's Print History Project database front end.
https://womensprinthistoryproject.com/
GNU General Public License v2.0
1 stars 8 forks source link

Person Search: Unable to search for a person by their full name in the “person” search. #223

Closed mnl101 closed 3 years ago

mnl101 commented 3 years ago

Describe the bug: When we search for a full name in the person search, it brings up all results that include the first or last name, and does not bring up the most relevant result first. If you search for the full name in quotations, it produces no results.

To reproduce: Click on “Database” in the top header and “Person Search” in the drop down menu Type in Charlotte Smith (no quotations) and hit search. It brings up all “Charlotte” and all “Smith” (99) results. Type in “Charlotte Smith” (with quotations) and hit search It brings up zero results, even though we have two Charlotte Smiths in the database Same for Smith, Charlotte (99 results) and "Smith, Charlotte" (0 results) Charlotte and Smith (100 results); "Charlotte and Smith" (0 results)

Expected results: When a user searches for a full name, it should bring up the most relevant entry first (ie. the entry that has both names the user searched for).

Additional context: N/A

ubermichael commented 3 years ago

The problem here is that the first name and last name fields are different. So when searching for a person by name we must search the first name and last name fields.

So I have changed the person name search so that including quotes around a name will change the nature of searching from a full text match to a first name last name comparison.

Examples:

mnl101 commented 3 years ago

thanks Michael, good solution!