API: /dataset/suggest/ Elasticsearch errors

Noticed recently in rgbif examples that some /dataset/suggest/ queries that used to work are no longer working. E.g.,

 curl -v 'https://api.gbif.org/v1/dataset/suggest?limit=5&keyword=france' |  jq .
> GET /v1/dataset/suggest?limit=5&keyword=france HTTP/2
> Host: api.gbif.org
> User-Agent: curl/7.64.1
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 500 ...

{
  "timestamp": "2020-06-12T00:05:36.737+0000",
  "status": 500,
  "error": "Internal Server Error",
  "message": "Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]",
  "path": "/dataset/suggest"
}

Seems like all queries that include the q param do work though, so perhaps q parameter is now required for a successful query?

Thanks @sckott - we recently refactored some code around this, and seemingly a bug has crept in as it was not intended to change anything. I’ve opened https://github.com/gbif/registry/issues/200

Thanks Tim!

Related-ish: I assume Elasticsearch errors aren’t sent down in the payload on purpose. Or are they? Curious to know in case I need to change my error catching code

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.