gbif / hosted-portals

Support material for establishing the GBIF Hosted Portals
Apache License 2.0
10 stars 6 forks source link

Partial matches when querying? #153

Closed langeveldNMR closed 3 years ago

langeveldNMR commented 3 years ago

The filters (e.g. Scientific name, Locality) that can be queried seem to only yield exact matches and no partial matches. Would it be possible to also include partial matches? This would greatly facilitate users, I think. For example, querying our portal https://hp-nhm-rotterdam.gbif-staging.org/data on Scientific name for 'Mammuthus primigenius (Blumenbach, 1799)' results in 997 results https://hp-nhm-rotterdam.gbif-staging.org/data?filter=eyJtdXN0Ijp7InRheG9uS2V5IjpbNDgyNTgzM119fQ%3D%3D, but querying for 'Mammuthus' yields none https://hp-nhm-rotterdam.gbif-staging.org/data?filter=eyJtdXN0Ijp7InRheG9uS2V5IjpbODQxMTIzMF19fQ%3D%3D Another example: querying Locality for 'Rotterdam, Hoek van Holland' returns 1231 results https://hp-nhm-rotterdam.gbif-staging.org/data?filter=eyJtdXN0Ijp7ImxvY2FsaXR5IjpbIlJvdHRlcmRhbSwgaG9layB2YW4gaG9sbGFuZCJdfX0%3D, but 'Hoek van Holland' returns none https://hp-nhm-rotterdam.gbif-staging.org/data?filter=eyJtdXN0Ijp7ImxvY2FsaXR5IjpbIkhvZWsgdmFuIEhvbGxhbmQiXX19

MortenHofft commented 3 years ago

Hi @langeveldNMR The filters come in multiple types.

locality is the text provided by the publisher. And when searching it, then you search for the string as published by the publisher. Exactly as published. Same as you would see on GBIF.org - that isn't to say it is perfect, but that is the behaviour and have been since we introduced filtering on that field on GBIF.org. See this related issue

scientificName a search for a scientific name will include all children. But!, not if it is a synonym. Then it is a name search. And in this case your scientific name is a synonym. And there are no usages of that name in your data scope. Had you instead search for https://hp-nhm-rotterdam.gbif-staging.org/data?filter=eyJtdXN0Ijp7InRheG9uS2V5IjpbNDgyNTgzMl19fQ%3D%3D Then you would see all the results from before + the ones that only have a higher taxon match. This is also the same behaviour as GBIF.org. Again, it is not to claim that it is perfect. I've created an issue to capture this problem.

I'm closing this issue as I believe the problem is better captured in those 2 other issues. Please tell me if I've missed something

MortenHofft commented 3 years ago

This is now possible

Screenshot 2021-05-19 at 22 02 48