Hi,
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, driver_username=louis@yahoo.com}]
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=http://127.0.0.1:10200, response=HTTP/1.1 200 OK}
Here's a code fragment:
ActionListener<SearchResponse> actionListener = new ActionListener<SearchResponse>() {
@Override
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();
arrayList.add(sourceAsMap);
}
successFunction.apply(arrayList);
}
@Override
public void onFailure(Exception excptn) {
System.err.println("Exception::: " + excptn.getMessage());
successFunction.apply(new ArrayList());
}
};
Thanks in advance.