gbif / portal16

GBIF.org website
https://www.gbif.org
Apache License 2.0
24 stars 15 forks source link

Add programme filter to project (resource) search page #1872

Closed dnoesgaard closed 1 year ago

dnoesgaard commented 1 year ago

Hopefully this is an easy one :)

One this page: https://www.gbif.org/resource/search?contentType=project

add filter/facet for Programme (e.g. show only programme=BID, etc.)

MortenHofft commented 1 year ago

So is that the programme acronym like in literature search? https://www.gbif.org/resource/search?contentType=literature&gbifProgrammeAcronym=CESP

dnoesgaard commented 1 year ago

Yes, that's what we would like to be able to choose from in the filter.

MortenHofft commented 1 year ago

@fmendezh could we add the programme acronym as a keyword to the ES projects index? I see that it is already in there in Contentful, we just do not include it for projects (it is there for the programme index itself).

@dnoesgaard are they case sensitive? My guess would be to make them uppercase in the response, but case insensitive in the matching? And that suggest isn't required, but that facets would be nice?

MortenHofft commented 1 year ago

@fmendezh I just looked at the mapping and noticed that the projects index programmes as a nested field. Since a project belongs to one programme only (that is correct is it not?) then the nested type seems overly complex. It makes querying more complicated, in a case where there is no need as far as I can see. Would it be much hassle for you to change it?

dnoesgaard commented 1 year ago

Right now, we have four programmes in Contentful:

BID BIFA CESP Northern Eurasia (doesn't have an acronym in Contentful)

So maybe it's better to use the full names? I'm actually a bit confused about what the acronym in Contentful is used for...

MortenHofft commented 1 year ago

Northern Eurasia now have an acronym. I've added required and unique as constraints to the Contentful model. Essentially making it a meaningful ID. That should solve the issue that we search literature by acronyms that aren't always available. And allow us to search projects using the same approach.