@@ -21,12 +21,12 @@ namespace Nest
21
21
[ InterfaceDataContract ]
22
22
public interface IAttachmentProcessor : IProcessor
23
23
{
24
- /// <summary> The field to get the base64 encoded field from </summary>
24
+ /// <summary> The field to get the base64 encoded field from. </summary>
25
25
[ DataMember ( Name = "field" ) ]
26
26
Field Field { get ; set ; }
27
27
28
28
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>
30
30
[ DataMember ( Name = "ignore_missing" ) ]
31
31
bool ? IgnoreMissing { get ; set ; }
32
32
@@ -37,20 +37,26 @@ public interface IAttachmentProcessor : IProcessor
37
37
[ DataMember ( Name = "indexed_chars" ) ]
38
38
long ? IndexedCharacters { get ; set ; }
39
39
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>
41
41
[ DataMember ( Name = "indexed_chars_field" ) ]
42
42
Field IndexedCharactersField { get ; set ; }
43
43
44
44
/// <summary>
45
45
/// 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.
47
47
/// </summary>
48
48
[ DataMember ( Name = "properties" ) ]
49
49
IEnumerable < string > Properties { get ; set ; }
50
50
51
- /// <summary> The field that will hold the attachment information </summary>
51
+ /// <summary> The field that will hold the attachment information. </summary>
52
52
[ DataMember ( Name = "target_field" ) ]
53
53
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 ; }
54
60
}
55
61
56
62
/// <inheritdoc cref="IAttachmentProcessor" />
@@ -75,6 +81,9 @@ public class AttachmentProcessor : ProcessorBase, IAttachmentProcessor
75
81
/// <inheritdoc cref="IAttachmentProcessor.TargetField" />
76
82
public Field TargetField { get ; set ; }
77
83
84
+ /// <inheritdoc cref="IAttachmentProcessor.ResourceName" />
85
+ public Field ResourceName { get ; set ; }
86
+
78
87
protected override string Name => "attachment" ;
79
88
}
80
89
@@ -91,6 +100,7 @@ public class AttachmentProcessorDescriptor<T>
91
100
Field IAttachmentProcessor . IndexedCharactersField { get ; set ; }
92
101
IEnumerable < string > IAttachmentProcessor . Properties { get ; set ; }
93
102
Field IAttachmentProcessor . TargetField { get ; set ; }
103
+ Field IAttachmentProcessor . ResourceName { get ; set ; }
94
104
95
105
/// <inheritdoc cref="IAttachmentProcessor.Field" />
96
106
public AttachmentProcessorDescriptor < T > Field ( Field field ) => Assign ( field , ( a , v ) => a . Field = v ) ;
@@ -122,5 +132,11 @@ public AttachmentProcessorDescriptor<T> IndexedCharactersField<TValue>(Expressio
122
132
123
133
/// <inheritdoc cref="IAttachmentProcessor.Properties" />
124
134
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 ) ;
125
141
}
126
142
}
0 commit comments