[ https://issues.apache.org/jira/browse/NIFI-10948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733130#comment-17733130 ]
Chris Sampson commented on NIFI-10948: -------------------------------------- I would probably suggest a feature request ticket to create an OpenSearch compatible Controller Service, i.e. an alternative implementaion of the {{ElasticsearchClientService}} API interface to the existing {{ElasticsearchClientServiceImpl}} that connects to Elastic-based Elasticsearch instances for the REST-based Elasticsearch processors. It would hopefully be sufficient to retain the same processors but allow for different connections (controller services) to OpenSearch vs. Elasticsearch. There could, of course, be instances where functionality is only available in one service and not the other where service-specific processors would be needed, but the basic set of Put and Get/Search processors would hopefully be fine with just different Controller Services configured. > QueryElasticsearchHTTP doesnt work on Opensearch (and possibly newer > Elasticsearch versions) > -------------------------------------------------------------------------------------------- > > Key: NIFI-10948 > URL: https://issues.apache.org/jira/browse/NIFI-10948 > Project: Apache NiFi > Issue Type: Improvement > Components: Extensions > Affects Versions: 1.15.3 > Environment: Nifi 1.15.3 on centos machine > Reporter: David Vassallo > Priority: Minor > Attachments: image-2022-12-05-16-34-20-513.png > > > The QueryElasticsearchHTTP processor will return a "Null Pointer Exception" > when running agasint Opensearch and probably newer versions of Elasticsearch. > I tracked down the null pointer to this line: > > [https://github.com/apache/nifi/blob/0ebc6d31489e975dcbbe078fa572332ef8ffa9e2/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/QueryElasticsearchHttp.java#L418] > > The processor is looking for the "_type" field which is no longer in the > right place. In opensearch v 1.x and above (possibly Elasticsearch too, but I > dont have the means to test this), the field has moved to be a child of the > "@metadata" field: > !image-2022-12-05-16-34-20-513.png! > > If you try to circumvent this issue by populating the "Type" property of the > processor, you will get an HTTP 400 Bad Message response since the processor > builds a URL with the "size" and "from" arguments as part of the URL which > are not supported by Opensearch/Elasticsearch in more recent versions, so you > are forced to leave this property empty but then run into the null problem > described above -- This message was sent by Atlassian Jira (v8.20.10#820010)