nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Hynar (Jira)" <j...@apache.org>
Subject [jira] [Commented] (NIFI-6458) ElasticSearchClientServiceImpl does not support Elasticserch 7 due to changes in search responses
Date Thu, 23 Apr 2020 19:09:00 GMT

    [ https://issues.apache.org/jira/browse/NIFI-6458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090851#comment-17090851
] 

Martin Hynar commented on NIFI-6458:
------------------------------------

This problem is making JsonQueryElasticsearch when used with ES7x which is unfortunate. Is
there any workaround for this, or will it be solved?

> ElasticSearchClientServiceImpl does not support Elasticserch 7 due to changes in search
responses
> -------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-6458
>                 URL: https://issues.apache.org/jira/browse/NIFI-6458
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework, Extensions
>    Affects Versions: 1.9.2
>         Environment: NiFi 1.9.2, Elasticsearch 7.1.1
>            Reporter: Yury Sergeev
>            Priority: Minor
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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" : {
>             "value": 2048,    
>             "relation": "eq"  
>         },
>         "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



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message