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



##########
File path: 
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractElasticsearchHttpProcessor.java
##########
@@ -343,11 +375,48 @@ protected void buildBulkCommand(StringBuilder sb, String 
index, String docType,
         } else if (indexOp.equalsIgnoreCase("delete")) {
             sb.append("{\"delete\": { \"_index\": \"");
             sb.append(StringEscapeUtils.escapeJson(index));
-            sb.append("\", \"_type\": \"");
-            sb.append(StringEscapeUtils.escapeJson(docType));
-            sb.append("\", \"_id\": \"");
+            sb.append("\"");
+            if (!(StringUtils.isEmpty(docType) | docType == null)){
+                sb.append(", \"_type\": \"");
+                sb.append(StringEscapeUtils.escapeJson(docType));
+                sb.append("\"");
+            }
+            sb.append(", \"_id\": \"");
             sb.append(StringEscapeUtils.escapeJson(id));
-            sb.append("\" }\n");
+            sb.append("\" }}\n");
+        }
+    }
+
+    protected String getFieldIncludeParameter(ElasticsearchVersion esVersion) {
+        return esVersion.equals(ElasticsearchVersion.ES_LESS_THAN_7)
+                ? FIELD_INCLUDE_QUERY_PARAM : FIELD_INCLUDE_QUERY_PARAM_ES7;
+    }
+
+    static class ElasticsearchTypeValidator implements Validator {

Review comment:
       Not needed if the ES version parameter goes away




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