Search should not return 404 in case there are no matching data in Elasticsearch
The expected result:
- When no data matches the query response is 200 OK with an empty list.
Actual results are:
- Inconsistent, sometimes it's 200 OK sometimes it's 400.
Reason:
- Not all requests to ElasticSearch have parameters to ignore user errors, usually, those are preliminary requests to get details for further search queries, for example: https://community.opengroup.org/osdu/platform/system/search-service/-/blob/master/search-core/src/main/java/org/opengroup/osdu/search/service/FieldMappingTypeService.java#L49
Solution:
- Suppress all 400 errors from Elasticsearch and respond to the end user only with 200 OK.
Pros:
- More consistent workflow for client applications.
- Reduced error handling for client applications.
More details are in the attached CSV files: