snow match the AOU code SNOW for Snowy Owl when using the /v1/taxa API call, but it does for /v1/taxa/autocomplete? I would’ve thought the “best match” would be SNOW in both cases because it’s the only record that exactly matches what the user typed.
As some of you may remember from my earlier question, I’m building a Discord bot that answers various queries, and am using /v1/taxa because it supports filtering on rank & taxon_id. I have proposed a solution to this particular issue here that would have it automatically switch to /v1/taxa/autocomplete so long as there are no rank or taxon_id filters in the query. This will probably get better results than /v1/taxa so long as they typed enough to make it unique. However, it would still mean an inconsistent outcome if they got overly specific with their query, e.g. with a
species rank filter. If I just advise them to type nothing but the bird code in the help, though, that should get around that problem.
I only ask because if I follow this plan, even if I do document the limitation, I anticipate there will still be those who notice less accurate results when they give a more specific query that they could reasonably expect to match.
Here are the two queries for you to compare:
- This does match Snowy Owl, but not as the 1st result. The 1st result is “Dark-eyed Junco” (aka. “Snowbird”) which is not what a birder who knows the AOU code SNOW would expect.
- It also returns the Snowy Owl record with “matched_term”:“Snowy Owl”, so I can’t post-filter the result to bump up the score of an exact match on the term & select that result in favour of results closer to the top of the results.
- This returns “matched_term”:“SNOW” as the 1st result so that’s what the bot command would return if I switched over. A great improvement!