Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAIN B-20447 Customer Search Sorting Fixes #13467

Merged
merged 7 commits into from
Aug 14, 2024

Conversation

brooklyn-welsh
Copy link
Contributor

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):

  1. Names weren't sorted by closest match, i.e. a search for "Ted" would have a user with the last name, first name of "Submitted, HHG" appear at the top, several spots above a user with the name "Marine, Ted". Exact matches now appear at the top of the search results.
  2. Sorting on the customer name field was a combination of last name and first name, which led to changing the sort from ascending to descending not actually doing much. For example if you were to have this list in an descending sort:
  • Submitted, HHG
  • Submitted, PPM
  • Unsubmitted, PPM

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:

  • Submitted, PPM
  • Submitted, HHG
  • Unsubmitted, PPM

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.

Copy link
Contributor

@KonstanceH KonstanceH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@taeJungCaci taeJungCaci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@taeJungCaci taeJungCaci merged commit 5bba66a into main Aug 14, 2024
41 checks passed
@taeJungCaci taeJungCaci deleted the MAIN-B-20447-customer-search branch August 14, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ByteSize M&Ms Team ByteSized M&Ms MAIN
Development

Successfully merging this pull request may close these issues.

3 participants