Web Client: Patron Search sorted by last name not working as expected

Bug #1724029 reported by Terran McCanna
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
3.0
Fix Released
High
Unassigned

Bug Description

In 3.0.0...

We're seeing unexpected results when sorting by last name in the patron search results screen.

See attached screenshots:
On demo.evergreen.org I modified some of the Smiths in order to test and searched by smith. As you see in the screenshot, Smith-Smith appeared in an odd place, and S'mith didn't appear at all.

On our PINES test server, I searched by dale, and the D'Alessandros appeared in different spots in the results.

Revision history for this message
Terran McCanna (tmccanna) wrote :
Revision history for this message
Terran McCanna (tmccanna) wrote :
Revision history for this message
Terran McCanna (tmccanna) wrote :

Tested again in 3.0.1, still not sorting correctly.

Revision history for this message
Terran McCanna (tmccanna) wrote :

Sorting solely by DOB (either thru column config or by clicking on column header) doesn't work either. See example.

Revision history for this message
Terran McCanna (tmccanna) wrote :
Revision history for this message
Andrea Neiman (aneiman) wrote :

I was definitely seeing some wonkiness (but slightly different wonkiness) in demo.evergreencatalog.com yesterday, but I failed to screenshot it and now I'm having trouble getting into that system.

On a separate 3.0.0 test system I was not seeing any of the issues with Patron Search Results -- First Name, Last Name, Middle Name, DOB, Create Date all sort up & down completely as expected.

HOWEVER, then I changed a patron's last name from Davis to D'avis, and now I see the following sort:

D'avis
Daniels
Davenport
Davis
(etc)

Where I would expect sort to ignore the apostrophe.

Not sure if that is related. I can open a separate bug if it's another issue.

Revision history for this message
Terran McCanna (tmccanna) wrote :

I'm still seeing significant problems with last name sorting. See examples when I put "dal" as the last name - It does push most of the names beginning with d'al to the top, but then within those names it's not sorting correctly.

Further down the list in the "dalber" section it has "dalbert" before "dalberg" etc.

It's almost like it's sorting in clumps so that things are sort of grouped together but not actually in order.

Revision history for this message
Terran McCanna (tmccanna) wrote :
Revision history for this message
Terran McCanna (tmccanna) wrote :

To expand on this, first name and middle name sorting are off as well. The attached examples all had the same last name and were sorted by clicking on the column headers.

Revision history for this message
Terran McCanna (tmccanna) wrote :
Revision history for this message
Joan Kranich (jkranich) wrote :

Release 3.0.3

When I search by last name only, the first names are in alphabetical order and then the alphabetizing starts over again.

In one test the first 16 results are in order and then line 17 starts again with first names beginning with the letter 'a'.
In most tests the first 25 results are in order and then the sorting starts over again.
I have the rows set to 50.

I am not clicking the column headers to sort just retrieving results.

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Jason Stephenson (jstephenson) wrote :

I'm setting the importance to High because it has been identified to me as critical to fix this.

Changed in evergreen:
importance: Undecided → High
Dan Pearl (dpearl)
Changed in evergreen:
assignee: nobody → Dan Pearl (dpearl)
Dan Pearl (dpearl)
Changed in evergreen:
assignee: Dan Pearl (dpearl) → nobody
Kathy Lussier (klussier)
tags: added: webstaffblocker
Revision history for this message
Bill Erickson (berick) wrote :

Has anyone been able to reproduce this on the test/concerto data set? It may not be possible, given the limited amount of data, but very helpful if possible.

Barring that, it would be helpful to know if the sorting is off in the patron search database query or if the UI is getting them jumbled. Hint, search for "unaccent_and_squash" in the PG logs.

Revision history for this message
Terran McCanna (tmccanna) wrote :

Hi Bill - the first example and attachment at the top of this thread was in master with Concerto data, but I did change a few of the Concerto patron names to make it easier to test.

Revision history for this message
Bill Erickson (berick) wrote :

Thanks, Terran.

I am unable to reproduce :( I have 25 "Smith" patrons, a "S'mith", a "Smith-Smith", and a "Smithfield". They reliably display in the expected order S'mith => Smith => Smith-Smith => Smithfield.

Are any column "Sort Priority" values applied to columns in the Manage Columns interface?

Revision history for this message
Terran McCanna (tmccanna) wrote :

I can no longer reproduce it on Concerto, so that's good.

We are still seeing it with our full data set on 3.0.2, and don't have a 3.1 test server set up with our full data yet, so I'm not sure if something has been fixed between the two versions or if it only occurs once the data set becomes too large. It's almost as if it's loading a handful of records at a time, sorting those, then loading the next set and sorting those. I'm attaching another set of screenshots where I did a last name search, then sorted the results by first name (highlighting shows the places where there was a glitch in sorting.)

I confirmed that no priority values were set in the Manage Columns interface, and also tested on multiple browsers and machines to make sure there wasn't a stored preference or cache complicating things.

Once we have a 3.1 test server with our full data set on it, I'll test further.

tags: added: sorting
Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

We're seeing this on our live 3.1 server.

Revision history for this message
Chris Sharp (chrissharp123) wrote :

More data here.

I did searches on "Sharp" and "Dale" in the PINES database, and the sorting is wrong in the UI as described, but when running the query directly via psql, the sorting is correct.

Revision history for this message
Bill Erickson (berick) wrote :

Chris, just to confirm, you said in IRC that running the patron search API via srfsh returned results out of order?

Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Fix pushed:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1724029-patron-search-api-ordering

There appears to be a problem with the OpenSRF max_chunk_size API decorator. For reasons not yet clear to me, it results in responses getting returned in the wrong order. I have replaced the use of max_chunk_size with the preferred max_bundle_count. This does not suffer from the sorting issues and its meaning is more clear in the code.

Note I reviewed the code and the only other cases of max_chunk_size I found were setting the value to 0, which effectively disables it, so we shouldn't have any more of these lurking.

Changed in evergreen:
milestone: none → 3.1.5
assignee: Bill Erickson (berick) → nobody
tags: added: pullrequest
Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

Tested this patch on a 3.1.4 server with production data. Prior to loading the patch, searches on the last name "dale" when sorted by last name consistently showed sequences like:

Dalelio
Dalessandro
Dalelio
Dalelio

and

Daley
Daley
Dalessio
Daley
Daley

Sorting by first name consistently showed sequences like:

Angela
Austin
Bernadette
Bob
Alex
Amanda

and

Craig
Crystal
Brian
Brian
Brittany
Brittany
Brooke
Cailin
Caitlin

After applying the fix, all fields are now sorting as they should. My signoff branch is at:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/mmorgan/lp1724029-patron-search-api-ordering-signoff

tags: added: signedoff
Changed in evergreen:
assignee: Michele Morgan (mmorgan) → nobody
Revision history for this message
Bill Erickson (berick) wrote :

Thanks, Michele! I've merged to 3.0 and up.

Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
status: Confirmed → Fix Committed
assignee: Bill Erickson (berick) → nobody
Dan Wells (dbw2)
Changed in evergreen:
milestone: 3.1.5 → 3.1.6
milestone: 3.1.6 → 3.1.5
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.