@@ -21,12 +21,12 @@ namespace Nest
2121 [ InterfaceDataContract ]
2222 public interface IAttachmentProcessor : IProcessor
2323 {
24- /// <summary> The field to get the base64 encoded field from </summary>
24+ /// <summary> The field to get the base64 encoded field from. </summary>
2525 [ DataMember ( Name = "field" ) ]
2626 Field Field { get ; set ; }
2727
2828
29- /// <summary> If `true` and `field` does not exist, the processor quietly exits without modifying the document </summary>
29+ /// <summary> If `true` and `field` does not exist, the processor quietly exits without modifying the document. </summary>
3030 [ DataMember ( Name = "ignore_missing" ) ]
3131 bool ? IgnoreMissing { get ; set ; }
3232
@@ -37,20 +37,26 @@ public interface IAttachmentProcessor : IProcessor
3737 [ DataMember ( Name = "indexed_chars" ) ]
3838 long ? IndexedCharacters { get ; set ; }
3939
40- /// <summary> Field name from which you can overwrite the number of chars being used for extraction. </summary>
40+ /// <summary> Field name from which you can overwrite the number of chars being used for extraction.</summary>
4141 [ DataMember ( Name = "indexed_chars_field" ) ]
4242 Field IndexedCharactersField { get ; set ; }
4343
4444 /// <summary>
4545 /// Properties to select to be stored. Can be content, title, name, author,
46- /// keywords, date, content_type, content_length, language. Defaults to all
46+ /// keywords, date, content_type, content_length, language. Defaults to all.
4747 /// </summary>
4848 [ DataMember ( Name = "properties" ) ]
4949 IEnumerable < string > Properties { get ; set ; }
5050
51- /// <summary> The field that will hold the attachment information </summary>
51+ /// <summary> The field that will hold the attachment information. </summary>
5252 [ DataMember ( Name = "target_field" ) ]
5353 Field TargetField { get ; set ; }
54+
55+ /// <summary> The field containing the name of the resource to decode.
56+ /// If specified, the processor passes this resource name to the underlying
57+ /// Tika library to enable 'Resource Name Based Detection'.</summary>
58+ [ DataMember ( Name = "resource_name" ) ]
59+ Field ResourceName { get ; set ; }
5460 }
5561
5662 /// <inheritdoc cref="IAttachmentProcessor" />
@@ -75,6 +81,9 @@ public class AttachmentProcessor : ProcessorBase, IAttachmentProcessor
7581 /// <inheritdoc cref="IAttachmentProcessor.TargetField" />
7682 public Field TargetField { get ; set ; }
7783
84+ /// <inheritdoc cref="IAttachmentProcessor.ResourceName" />
85+ public Field ResourceName { get ; set ; }
86+
7887 protected override string Name => "attachment" ;
7988 }
8089
@@ -91,6 +100,7 @@ public class AttachmentProcessorDescriptor<T>
91100 Field IAttachmentProcessor . IndexedCharactersField { get ; set ; }
92101 IEnumerable < string > IAttachmentProcessor . Properties { get ; set ; }
93102 Field IAttachmentProcessor . TargetField { get ; set ; }
103+ Field IAttachmentProcessor . ResourceName { get ; set ; }
94104
95105 /// <inheritdoc cref="IAttachmentProcessor.Field" />
96106 public AttachmentProcessorDescriptor < T > Field ( Field field ) => Assign ( field , ( a , v ) => a . Field = v ) ;
@@ -122,5 +132,11 @@ public AttachmentProcessorDescriptor<T> IndexedCharactersField<TValue>(Expressio
122132
123133 /// <inheritdoc cref="IAttachmentProcessor.Properties" />
124134 public AttachmentProcessorDescriptor < T > Properties ( params string [ ] properties ) => Assign ( properties , ( a , v ) => a . Properties = v ) ;
135+
136+ /// <inheritdoc cref="IAttachmentProcessor.ResourceName" />
137+ public AttachmentProcessorDescriptor < T > ResourceName ( Field field ) => Assign ( field , ( a , v ) => a . ResourceName = v ) ;
138+
139+ /// <inheritdoc cref="IAttachmentProcessor.TargetField" />
140+ public AttachmentProcessorDescriptor < T > ResourceName < TValue > ( Expression < Func < T , TValue > > objectPath ) => Assign ( objectPath , ( a , v ) => a . ResourceName = v ) ;
125141 }
126142}
0 commit comments