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

Type search in location form: prioritise prefix matches #635

Open
wbazant opened this issue Dec 10, 2024 · 1 comment · May be fixed by #641
Open

Type search in location form: prioritise prefix matches #635

wbazant opened this issue Dec 10, 2024 · 1 comment · May be fixed by #641
Labels
enhancement New feature request

Comments

@wbazant
Copy link
Collaborator

wbazant commented Dec 10, 2024

User experiences:

  • "Apple" currently doesn't show apples, but a Fraser island apple, an unrelated species whose scientific name is before "M". I've learned to just type Malus in, but I know that the list is ordered alphabetically by scientific name.

  • I watch a friend try to input a location of an elderberry, and he typed "elderflower". It was irrelevant and stopped matching after f, so he was confused and felt like he doesn't know plants - had to close the site, go to google, find the Latin name Sambucus nigra, and put that in.

This issue proposes preferring prefix matches over substring matches when there's a search term entered - easy change but should improve the experience.

@wbazant wbazant added the enhancement New feature request label Dec 10, 2024
@ezwelty
Copy link
Collaborator

ezwelty commented Dec 10, 2024

I watch a friend try to input a location of an elderberry, and he typed "elderflower".

This is an interesting case, because "elderflower" is a synonym English name returned by the API. If we expanded the search to all common names (or at least those in the currently selected language), it would have worked as expected in this case, although also maybe confusing because the match would be "invisible".

@wbazant Thanks for these reports. I'm open to change but I'm not sure I understand what you are suggesting. If matches are only allowed from the start of the string, then searching for "elderberry" would fail to match "black elderberry". Are you suggesting sorting search results by (prefix match, substring match, pending type, original order)?

p.s. Random thought about sorting: The API /types endpoint could return a count of (user-added) locations per type as a way to sort the dropdown?

In the long run, I wonder if this search shouldn't be more like searching through type profiles, where search results are more like tiles (maybe a photo, the taxonomic rank, a link to the profile page, matching synonym names) and the option to view that profile page before making the final selection. But that's for another epic.

@wbazant wbazant linked a pull request Dec 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants