searchAsync is calling both OnResponse and onFailure

i've got a little problem.

im running an async search that first returns calls OnResponse with the desired result then immediately calls onFailure.
The index i'm querying contains exactly one single row.

Please is this normal behavior?

Result::: [{order_outletid=1, driver_outletid=1, driver_parentservice=1, orderid=1bcee6c6-5e13-44ac-902b-7baf0575cbe4, order_parentshop=1,}]

Exception::: Unable to parse response body for Response{requestLine=POST /contacteddrivers/_search?typed_keys=true&max_concurrent_shard_requests=5&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true HTTP/1.1, host=, response=HTTP/1.1 200 OK}

Here's a code fragment:

ActionListener<SearchResponse> actionListener = new ActionListener<SearchResponse>() {
            public void onResponse(SearchResponse searchResponse) {
                ArrayList<Map<String, Object>> arrayList = new ArrayList<>();
                SearchHits hits = searchResponse.getHits();
                SearchHit[] searchHits = hits.getHits();
                for (SearchHit hit : searchHits) {// do something with the SearchHit
                    Map<String, Object> sourceAsMap = hit.getSourceAsMap();

            public void onFailure(Exception excptn) {
                System.err.println("Exception::: " + excptn.getMessage());
                successFunction.apply(new ArrayList());

Thanks in advance.

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