It has been seen in certain circumstances that FTS can return the following response to an FTS query as the status block:
We can see that there is an "errors" field in the response, but it is empty (which actually means there weren't any errors).
Now I do think that returning the errors block in the case of no errors is a bug within FTS (covered in MB-33830), I do think that the Java SDK has to be more sensible when handling it.
Especially as the Java SDK release cadence will produce a 'fix' much sooner than a server-side fix would.
The issue is that if the SDK receives a response similar to the following it will throw an exception:
From reviewing the SDK code, this is because we only check if the "errors" field exists and is a JsonObject or JsonArray - https://github.com/couchbase/couchbase-java-client/blob/ccd227cfa63f4571151b09ec5ebbe56b5c4ee43a/src/main/java/com/couchbase/client/java/search/result/impl/DefaultAsyncSearchQueryResult.java#L214-L232.
Instead, in the JsonObject block we need to be more smart and only set the errors if the object is not empty.
The result of this issue is that users code will throw exceptions even if the search query worked completely fine.