diff --git a/src/Nest/Ingest/Processors/SetProcessor.cs b/src/Nest/Ingest/Processors/SetProcessor.cs index e540b8ca14d..b58aefc88af 100644 --- a/src/Nest/Ingest/Processors/SetProcessor.cs +++ b/src/Nest/Ingest/Processors/SetProcessor.cs @@ -36,6 +36,16 @@ public interface ISetProcessor : IProcessor /// [DataMember(Name = "override")] bool? Override { get; set; } + + /// + /// If true and value is a template snippet that evaluates to null or the + /// empty string, the processor quietly exits without modifying the document. + /// Defaults to false. + /// + /// Valid in Elasticsearch 7.9.0+ + /// + [DataMember(Name = "ignore_empty_value")] + bool? IgnoreEmptyValue { get; set; } } /// @@ -47,6 +57,8 @@ public class SetProcessor : ProcessorBase, ISetProcessor public object Value { get; set; } /// public bool? Override { get; set; } + /// + public bool? IgnoreEmptyValue { get; set; } protected override string Name => "set"; } @@ -58,6 +70,7 @@ public class SetProcessorDescriptor : ProcessorDescriptorBase public SetProcessorDescriptor Field(Field field) => Assign(field, (a, v) => a.Field = v); @@ -71,5 +84,9 @@ public SetProcessorDescriptor Field(Expression> objec /// public SetProcessorDescriptor Override(bool? @override = true) => Assign(@override, (a, v) => a.Override = v); + + /// + public SetProcessorDescriptor IgnoreEmptyValue(bool? ignoreEmptyValue = true) => + Assign(ignoreEmptyValue, (a, v) => a.IgnoreEmptyValue = v); } }