You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Chris Sampson (Jira)" <ji...@apache.org> on 2020/11/15 21:18:00 UTC

[jira] [Commented] (NIFI-1911) Fetching Elasticsearch documents where source indexing is disabled causes NullPointerException

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

Chris Sampson commented on NIFI-1911:
-------------------------------------

Did this work if you as a dynamic processor property specifying the `_source` parameter (e.g. with a value of `data`)?

> Fetching Elasticsearch documents where source indexing is disabled causes NullPointerException
> ----------------------------------------------------------------------------------------------
>
>                 Key: NIFI-1911
>                 URL: https://issues.apache.org/jira/browse/NIFI-1911
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 0.6.1
>         Environment: Ubuntu 16.04 LTS
> NiFi 0.6.1
>            Reporter: Fredrik Skolmli
>            Priority: Minor
>              Labels: elasticsearch
>
> When fetching documents with the FetchElasticsearch processor (primarily to see whether or not the document is present), it fails and produces a java.lang.NullPointerException if the {{_source}} field is disabled. This is probably because of the empty response since the processor currently does not have the ability to specify fields.
> My ES index have the following settings:
> {code}
> {
>   "mappings": {
>     "test": {
>       "properties": {
>         "data": {
>           "index": "not_analyzed", 
>           "type": "string", 
>           "store": true
>         }
>       }, 
>       "_source": {
>         "enabled": false
>       }
>     }
>   }
> }
> {code}
> The document indexed is:
> {code}
> {'data': "Here's my data"}
> {code}
> I then created a FetchElasticsearch processor specifying the id manually, which produces the following error:
> {code}
> FetchElasticsearch[id=f0ef2fad-3778-4465-bb26-6faa27f5e03e] Failed to read StandardFlowFileRecord[uuid=1ab9c9a3-aab0-48fa-9beb-2d18d0fdf12c,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1463874100002-287, container=default, section=287], offset=980935, length=0],offset=0,name=1,size=0] from Elasticsearch due to null: java.lang.NullPointerException
> {code}
> Recreating the index with {{_source}} set to {{"enabled":"true"}} produces the expected result.
> Looks like a bug for me, but possibly rather an improvement suggestion to the processor, which should have a "fields" property.



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