ChrisSamo632 commented on code in PR #6701:
URL: https://github.com/apache/nifi/pull/6701#discussion_r1029386806
##########
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPaginatedJsonQueryElasticsearch.java:
##########
@@ -297,6 +297,10 @@ List<FlowFile> handleHits(final List<Map<String, Object>>
hits, final boolean ne
session.transfer(hitsFlowFiles, REL_HITS);
hitsFlowFiles.forEach(ff ->
session.getProvenanceReporter().receive(ff, transitUri,
stopWatch.getElapsed(TimeUnit.MILLISECONDS)));
hitsFlowFiles.clear();
+ } else if (getOutputNoHits()) {
Review Comment:
I think this should be moved into the `combineHits` method, e.g.
```java
if (hits != null && !hits.isEmpty()) {
...
} else if (getOutputNoHits()) {
final FlowFile hitFlowFile = createChildFlowFile(session, parent);
hitsFlowFiles.add(writeHitFlowFile(0, "", session, hitFlowFile,
attributes));
}
```
That leaves the FlowFile creation within the `combineHits` method and the
transfer of FlowFiles to output queues within this `handleHits` method
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]