Invalid query handling
Closed this issue · 2 comments
Hi,
I noticed that DHuS has changed the way it handles invalid query strings (such as
xxx:yyy) by returning a normal-looking response instead of a status 501 Internal Server Error.
There is a minor issue, though: the opensearch:totalResults
field is empty (in XML) or set to null
(in JSON). Also, the feed/link[@rel="last"]/@href
value contains a NaN.
Neither of these is a huge bug but they go against the OpenSearch spec and require special handling in client-side code.
Also, a minor nitpick would be that queries with unsupported parameters behave somewhat unexpectedly. It seems reasonable to expect that the following two queries produce the same result, but they don't:
- filename:S1* - 1802151 results
- filename:S1* OR xxx:yyy - 0 results
Hi @valgur,
Thank you for your interest to our project.
Our team took over this issue.
We 'll keep you updated.
Cheers,
DataHubSystem Team
The error codes and messages are now set correctly and have become much-much more informative. Thanks!