MAIN B-20447 Customer Search Sorting Fixes #13467
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Agility ticket
INT PRs
#13381
#13403
Summary
This branch fixes two problems that existed on the "Customer Search" tab (as well as other places where customer search was allowed):
Instead of "Unsubmitted" going to the top like you might expect when you change to ascending sort, it would instead reverse the sort inside of the last name groups like this:
Now, first name has been removed from the sort consideration, and the expected sort result occurs.
Also, matches were originally calculating match between first and last name separately, which led to some incorrect results. Now, it takes the similarity of the search string with both fields and gets the sum, ensuring that the closest match is always at the top.
Finally, sorting by Branch, phone, etc, would override the exact name matches in the name column, i.e.; results with Air Force branch would always come first regardless of match similarity with the given name search string. PO clarified that exact matches should still take precedent even when sorting via another column.
So, the search SQL query has been edited to always take match similarity into account first, i.e. if a result from the "Navy" branch is a closer match than a result from "Air Force", the "Navy" one should show up at the top anyway. The sort will instead affect the groups where match similarity is the same.
How to test
Instructions available in both INT PRs for the relevant changes in each.