mattyb149 commented on a change in pull request #4755:
URL: https://github.com/apache/nifi/pull/4755#discussion_r560432077
##########
File path:
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientServiceImpl.java
##########
@@ -90,6 +93,15 @@ public void onEnabled(final ConfigurationContext context)
throws InitializationE
try {
setupClient(context);
responseCharset =
Charset.forName(context.getProperty(CHARSET).getValue());
+
+ // re-create the ObjectMapper in case the SUPPRESS_NULLS property
has changed - the JsonInclude settings aren't dynamic
+ mapper = new ObjectMapper();
+ if
(ALWAYS_SUPPRESS.getValue().equals(context.getProperty(SUPPRESS_NULLS).getValue()))
{
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
Review comment:
I ran this with Never once and Always once, and both times with a field
`y` set to `null` it doesn't appear to get into the document. I expect that for
Always but if I query the document that had Never Suppress set and one field
(that is non-null in other docs in the index) that is null, shouldn't I expect
`"y": null` in the document returned by the query?
----------------------------------------------------------------
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]