Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.9.2
-
None
-
None
-
NiFi 1.9.2, Elasticsearch 7.1.1
Description
Due to the changes in Elasticsearch 7, now it returns a map, not Integer (see 'total.value' in the elastic 7 response), but the code in ElasticSearchClientServiceImpl.java expects to process an integer.
line 264:
int count = (Integer)hitsParent.get("total");
Elastic 7 response example:
{
"_shards": ...
"timed_out": false,
"took": 100,
"hits": {
"max_score": 1.0,
"total" :
,
"hits": ...
}
}
Elastic 6 response example:
{ "took" : 63, "timed_out" : false, "_shards" : \{ "total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 },
"hits" : {
"total" : 1000,
"max_score" : null,
"hits" : [ {
...
Therefore, the method of ElasticSearchClientServiceImpl search(String query, String index, String type) throws the following exception:
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.Integer: java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.Integer
Attachments
Issue Links
- is fixed by
-
NIFI-8002 Create new Elasticsearch Scroll/Paginated Query processor using REST API
- Resolved