Skip to content

Allow searching multiple words and ignore case with Taxonomy (GBIF) #5

@johnbradley

Description

@johnbradley

The Search Media API endpoint (/api/media) has a Taxonomy (GBIF) (f.taxonomy_gbif) query parameter.
Currently this parameter only works when a user queries with a single word and is case sensitive.
It would be helpful for this parameter to allow multiple words and be case insensitive.

Examples

The following examples use curl and jq.

If a user searches for "Pan troglodytes" no items are returned:

curl --silent --request GET \
  --header 'Accept: application/json' \
  --url 'https://www.morphosource.org/api/media?f.taxonomy_gbif=Pan+troglodytes' \
  | jq '.response .pages .total_count'
0

If a user searches for "Pan" 4484 items are returned:

curl --silent --request GET \
  --header 'Accept: application/json' \
  --url 'https://www.morphosource.org/api/media?f.taxonomy_gbif=Pan' \
  | jq '.response .pages .total_count'
4484

If a user searches for "troglodytes" 4455 items are returned:

curl --silent --request GET \
  --header 'Accept: application/json' \
  --url 'https://www.morphosource.org/api/media?f.taxonomy_gbif=troglodytes' \
  | jq '.response .pages .total_count'
4455

If a user searches for "pan" 0 items are returned:

curl --silent --request GET \
  --header 'Accept: application/json' \
  --url 'https://www.morphosource.org/api/media?f.taxonomy_gbif=pan' \
  | jq '.response .pages .total_count'
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