Skip to content

facetMinCount=0 in occurrence/search can lead to random results #431

@peterdesmet

Description

@peterdesmet

The following network has 357 datasets. That is also the number of facets shown (well 356 in fact):

https://api.gbif.org/v1/occurrence/search?network_key=ab013f3a-3c00-42cb-9fdb-cb5f4ba20a4b&limit=0&facet=datasetKey&facetLimit=500

However, when I add facetCount=0 it fills the facetLimit up to 500 records, including many datasets that do not belong to that network.

https://api.gbif.org/v1/occurrence/search?network_key=ab013f3a-3c00-42cb-9fdb-cb5f4ba20a4b&limit=0&facet=datasetKey&facetLimit=500&facetMincount=0


The error does not occur when searching for e.g. a publishingOrg with 18 datasets:

https://api.gbif.org/v1/occurrence/search?publishingOrg=05c249d0-dfa0-11d8-b22e-b8a03c50a862&limit=0&facet=datasetKey&facetLimit=50&facetMinCount=0


I think the API should result an error on facetMinCount=0, similar to:

https://api.gbif.org/v1/occurrence/search?network_key=ab013f3a-3c00-42cb-9fdb-cb5f4ba20a4b&limit=0&facet=datasetName&facetLimit=0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions