fix: generalizes player search query format #249
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.
Prior to this commit, the search query was used monolithically as a
single string to match the members' member id or their (comma-separated)
full name; this had many shortcomings, e.g., a search query " 12345 "
would fail to match a member with id "12345", and a search query
"surname name" would fail to match a member with full name "surname,
name". Also see #164 and #248.
In this commit, the search is first stripped of outer whitespace, which
helps search for member ids. If the search query is not an id, then the
search query is split into tokens, and a match with a member is found if
all of the respective query tokens match the member's full name. This
allows users to run queries such as "name", "surname", "name surname" or
"surname name".