fathomnet / worms-server

Fast WoRMS name server
http://fathomnet.org:8888/docs/
MIT License
9 stars 1 forks source link

Scope starts with by rank and/or known parent #4

Closed ermbutler closed 9 months ago

ermbutler commented 9 months ago

I am using the following endpoint for an autocomplete: https://fathomnet.org/worms/taxa/query/startswith

To allow for scoped results, we were wondering if these two options could be considered:

By rank:

Within a descendent of a parent:

Combination:

hohonuuli commented 9 months ago

@ermbutler This should be done now. Let me know if you run into any issues.

Test URLs for your examples

worms/taxa/query/startswith/str?rank=Family

https://fathomnet.org/worms/taxa/query/startswith/or?rank=family

worms/taxa/query/startswith/str?parent=Asteroidea

https://fathomnet.org/worms/taxa/query/startswith/or?parent=Asteroidea

worms/taxa/query/startswith/str?parent=Asteroidea&rank=Species

https://fathomnet.org/worms/taxa/query/startswith/or?parent=Asteroidea&rank=species

Other tests

hohonuuli commented 9 months ago

Notes:

hohonuuli commented 9 months ago

Released in v0.4.5

ermbutler commented 9 months ago

Thanks @hohonuuli, Appreciate the update! I am going to play with this now.

The current use case should be ok with the case sensitive parent, but I will let you know if that ends up tripping me up.