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

search: update user search behavior to filter by prefix #1872

Merged
merged 5 commits into from
Aug 27, 2021

Conversation

mastercactapus
Copy link
Member

Description:
This PR updates user search to follow a prefix-based approach.

Originally search was a simple substring match:
"abc" would match

  • "abc"
  • "Fooabc"
  • "Foo abc"
  • "Foo abcBar"

Recently a change was merged that uses a word-based approach:
"abc" would match only

  • "abc"
  • "Foo abc"

The new form makes sense for many services/policies/schedules as those are usually word-based. Names, however, can vary. This made it difficult as you'd need to type the entire first and/or last name to find a user, as partial matches would not work.

This PR implements a new strategy where each "word" of the search string must at least match a prefix of a "word" in the user's name.
"abc" would match

  • "abc"
  • "Foo abc"
  • "Foo abcBar"

Additionally, you could further restrict your search by adding multiple terms:
"f ab"
Matching both:

  • "Foo abc"
  • "Foo abcBar"

Which issue(s) this PR fixes:
As part of this, a fix is included to ensure search selects always reflect backend search results
Fixes #919

Out of Scope:
This change does not affect any search functionality beyond users.

KatieMSB
KatieMSB previously approved these changes Aug 26, 2021
m17ch
m17ch previously approved these changes Aug 26, 2021
@mastercactapus mastercactapus dismissed stale reviews from m17ch and KatieMSB via 98139ea August 27, 2021 14:48
@m17ch m17ch merged commit 6ef403c into master Aug 27, 2021
@m17ch m17ch deleted the user-prefix-search branch August 27, 2021 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

material select: search result discrepancy
3 participants