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

Allow exact string search queries (for things like taxa and projects) #336

Open
kaldari opened this issue Jul 13, 2022 · 2 comments
Open

Comments

@kaldari
Copy link

kaldari commented Jul 13, 2022

If I want to retrieve all the genera on iNaturalist called 'Hydria', I would use a query like:
https://api.inaturalist.org/v1/taxa?q=Hydria&is_active=true&rank=genus&all_names=false
Unfortunately, this also retrieves the genus Hydriastele since it starts with the string 'Hydria'. I know I can filter this out in post-processing, but it seems like there should be a way to query for 'Hydria' exactly rather than always doing a prefix search. Maybe a new boolean query parameter could be added called 'prefixsearch' (defaults to true) or 'exactstring' (defaults to false) or something like that.

@kaldari
Copy link
Author

kaldari commented Jul 13, 2022

It looks like the EOL API uses the query param 'exact' for this purpose.

@kueda
Copy link
Member

kueda commented Jul 15, 2022

IMO exact=true sounds useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants