11using Newtonsoft . Json ;
22using System ;
3- using System . Collections . Generic ;
4- using System . Linq ;
53using System . Linq . Expressions ;
6- using System . Text ;
7- using System . Threading . Tasks ;
84
95namespace Nest
106{
@@ -14,25 +10,42 @@ public interface IRemoveProcessor : IProcessor
1410 {
1511 [ JsonProperty ( "field" ) ]
1612 Field Field { get ; set ; }
13+
14+ /// <summary>
15+ /// If <c>true</c> and <see cref="Field"/> does not exist or is null,
16+ /// the processor quietly exits without modifying the document. Default is <c>false</c>
17+ /// </summary>
18+ [ JsonProperty ( "ignore_missing" ) ]
19+ bool ? IgnoreMissing { get ; set ; }
1720 }
1821
22+ /// <inheritdoc cref="IRemoveProcessor" />
1923 public class RemoveProcessor : ProcessorBase , IRemoveProcessor
2024 {
2125 protected override string Name => "remove" ;
26+ /// <inheritdoc cref="IRemoveProcessor.Field" />
2227 public Field Field { get ; set ; }
28+ /// <inheritdoc cref="IRemoveProcessor.IgnoreMissing" />
29+ public bool ? IgnoreMissing { get ; set ; }
2330 }
2431
32+ /// <inheritdoc cref="IRemoveProcessor" />
2533 public class RemoveProcessorDescriptor < T >
2634 : ProcessorDescriptorBase < RemoveProcessorDescriptor < T > , IRemoveProcessor > , IRemoveProcessor
2735 where T : class
2836 {
2937 protected override string Name => "remove" ;
3038
3139 Field IRemoveProcessor . Field { get ; set ; }
40+ bool ? IRemoveProcessor . IgnoreMissing { get ; set ; }
3241
42+ /// <inheritdoc cref="IRemoveProcessor.Field" />
3343 public RemoveProcessorDescriptor < T > Field ( Field field ) => Assign ( a => a . Field = field ) ;
3444
35- public RemoveProcessorDescriptor < T > Field ( Expression < Func < T , object > > objectPath ) =>
36- Assign ( a => a . Field = objectPath ) ;
45+ /// <inheritdoc cref="IRemoveProcessor.Field" />
46+ public RemoveProcessorDescriptor < T > Field ( Expression < Func < T , object > > objectPath ) => Assign ( a => a . Field = objectPath ) ;
47+
48+ /// <inheritdoc cref="IRemoveProcessor.IgnoreMissing" />
49+ public RemoveProcessorDescriptor < T > IgnoreMissing ( bool ? ignoreMissing = true ) => Assign ( a => a . IgnoreMissing = ignoreMissing ) ;
3750 }
3851}
0 commit comments