gbif / hosted-portals

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

Occurrences don't show in map when free text filter is set #225

Closed jholetschek closed 2 years ago

jholetschek commented 2 years ago

The free text fiter is very useful for non-scientific users. However, it seems not to work on the Map view. For example, there are a lot of hits for "berlin", many with coordinates (for example all records in the dataset "herbarium willing"). However, they don't show up in the map: https://herbarium.gbif.de/de/data/?datasetKey=85727f1e-f762-11e1-a439-00145eb45e9a&q=berlin&view=MAP

The number of records with coordinates matching the filter is correct.

MortenHofft commented 2 years ago

Ouch yes. I realize in this moment that we broke that when we starting using our new maps 3 months ago! That isn't good.

We had an existing maps service (which supported free text), but we then starting using a new service that supports multiple map projections. But in that process we lost the free text query support. It makes perfect sense why, but for some reason I didn't even consider it. For Hosted portals we ues the more expressive download predicates (negations and wildcard queries etc), but those do not support free text.

We will get it back, but I do not have the overview just now to say how much work is required.

Thank you for raising it!

MortenHofft commented 2 years ago

@jholetschek it isn't solved yet, but here is an update. The API needs to be extended with a new predicate type to support free text queries. Something along:

"predicate":{
  "type":"fullTextSearch",
  "value":"dog"
}

Once that is in place the hosted portals needs to be updated to use the new format.

ping @fmendezh

MortenHofft commented 2 years ago

I've implemented solution 2 from https://github.com/gbif/occurrence/issues/288#issuecomment-1130211723 in a branch and deployed it to staging. Have you considered removing the free text option for now @jholetschek? It isn't a good way to search for data in Berlin anyway 😄 - just see the results below. Looking at that you would think Berlin was a synonym for Greece

https://hp-herbarium-germany.gbif-staging.org/data/?q=berlin&view=MAP

Update: the fix is now in prod as well. I still hope version 1 or 3 will come about one day, but at least we do not have a production bug with this fix.

jholetschek commented 2 years ago

Hi Morten,

yes, Berlin yields too many hits, since it's part of all our dataset titles. Also of Herbarium Willing, a collector who gathered like crazy in Greece! But since the portal is intended not only for scientists, the filter is great, since it allows to find famours collectors easily: https://hp-herbarium-germany.gbif-staging.org/data/?q=humboldt&view=TABLE

Thanks for fixing this! Jörg