From 706d455163165303ed228e4bb816babea631defb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2020 10:31:50 +0100 Subject: [PATCH] [Backport 7.6] Add preserve_trailing to Split processor (#4424) Relates: #4341, elastic/elasticsearch#48664 Add the preserve_trailing property to split processor, which is available in Elasticsearch 7.6.0+ Co-authored-by: Russ Cam --- src/Nest/Ingest/Processors/SplitProcessor.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Nest/Ingest/Processors/SplitProcessor.cs b/src/Nest/Ingest/Processors/SplitProcessor.cs index d7be4ed4d2d..05f06cf125e 100644 --- a/src/Nest/Ingest/Processors/SplitProcessor.cs +++ b/src/Nest/Ingest/Processors/SplitProcessor.cs @@ -35,6 +35,14 @@ public interface ISplitProcessor : IProcessor /// [DataMember(Name = "target_field")] Field TargetField { get; set; } + + /// + /// Preserves empty trailing fields, if any. + /// + /// Available in Elasticsearch 7.6.0+. + /// + [DataMember(Name = "preserve_trailing")] + bool? PreserveTrailing { get; set; } } /// @@ -51,6 +59,9 @@ public class SplitProcessor : ProcessorBase, ISplitProcessor /// public Field TargetField { get; set; } + + /// + public bool? PreserveTrailing { get; set; } protected override string Name => "split"; } @@ -65,6 +76,7 @@ public class SplitProcessorDescriptor bool? ISplitProcessor.IgnoreMissing { get; set; } string ISplitProcessor.Separator { get; set; } Field ISplitProcessor.TargetField { get; set; } + bool? ISplitProcessor.PreserveTrailing { get; set; } /// public SplitProcessorDescriptor Field(Field field) => Assign(field, (a, v) => a.Field = v); @@ -85,5 +97,8 @@ public SplitProcessorDescriptor TargetField(Expression> objec /// public SplitProcessorDescriptor IgnoreMissing(bool? ignoreMissing = true) => Assign(ignoreMissing, (a, v) => a.IgnoreMissing = v); + + /// + public SplitProcessorDescriptor PreserveTrailing(bool? preserveTrailing = true) => Assign(preserveTrailing, (a, v) => a.PreserveTrailing = v); } }