ChrisSamo632 commented on a change in pull request #4153:
URL: https://github.com/apache/nifi/pull/4153#discussion_r523807145



##########
File path: 
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractElasticsearchHttpProcessor.java
##########
@@ -316,9 +341,12 @@ protected void buildBulkCommand(StringBuilder sb, String 
index, String docType,
         if (indexOp.equalsIgnoreCase("index")) {
             sb.append("{\"index\": { \"_index\": \"");
             sb.append(StringEscapeUtils.escapeJson(index));
-            sb.append("\", \"_type\": \"");
-            sb.append(StringEscapeUtils.escapeJson(docType));
             sb.append("\"");
+            if (!(StringUtils.isEmpty(docType) | docType == null)){

Review comment:
       Should probably use isBlank rather than isEmpty her and no need for the 
additional null (also use ||, not |)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to