Welcome to Codidact Meta!
Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.
User search only finds names which begin with the search term
The search field at the top of the users page appears to only search from the beginning of a username.
For example, trying to find my username, "trichoplax", succeeds only for prefixes of the name. Searching for the whole word works, but searching for anything less than the whole word only works if it includes the "t" at the start.
Search types
Prefixes
Prefixes such as "tri", "trich", and "trichop" all successfully return "trichoplax" as one of the results.
Postfixes
Postfixes such as "plax", "lax", and "ax" do not include "trichoplax" in the results.
Substrings
Substrings that are neither prefixes nor postfixes such as "rich", "hop", and "chop" also do not include "trichoplax" in the results.
Solutions
This can make results misleading, giving the impression that a username does not exist. I can see 2 potential solutions:
- Add a note to the page to make clear that only usernames with the search term as a prefix will be found.
- Expand the search to include any username with the search term as a substring (so all of the examples shown above would include "trichoplax" in the results).
I would much prefer solution 2, but if there is any reason to avoid or delay its implementation, solution 1 would be helpful in the meantime.
1 answer
celtschk says in a comment that we could show all relevant results and help the searcher by sorting those results in a useful order:
Another [way] to handle it would be to order the results by how well the search term matches. The exact match, if it exists, should certainly be the top result. The score for the remaining maches could then be how much of the user name matches (when typing "tri", and there [exists] a username "trixie", that should come before "trichoplax"). Matches that come earlier in the user name could score higher (so the when searching "tri", "trixie" coms before "matrix". Also you could make search case insensitive, but score the results after matching case (so a search for "Tri" sorts "Trick" above "trial".
Think about search engines: You don't mind getting thousands of hits if the hit you want is on the first page. And if it isn't, you are glad that you still can access further pages.
This makes sense to me. It sounds like the suggested order criteria are
- Result starts with match
- Result with shortest length
- Result case matches search
2 comment threads