1
1
using System ;
2
- using System . Collections ;
2
+ using System . Collections . Generic ;
3
3
using Newtonsoft . Json ;
4
4
5
5
namespace Nest
@@ -22,7 +22,7 @@ public class AttachmentProperty : PropertyBase, IAttachmentProperty
22
22
{
23
23
public AttachmentProperty ( ) : base ( "attachment" ) { }
24
24
25
- private IDictionary Dictionary => this . Fields ;
25
+ private IDictionary < PropertyName , IProperty > Dictionary => this . Fields ?? ( this . Fields = new Properties ( ) ) ;
26
26
27
27
public IStringProperty AuthorField
28
28
{
@@ -50,8 +50,8 @@ public IDateProperty DateField
50
50
51
51
public IStringProperty FileField
52
52
{
53
- get { return Dictionary [ "file " ] as IStringProperty ; }
54
- set { Dictionary [ "file " ] = value ; }
53
+ get { return Dictionary [ "content " ] as IStringProperty ; }
54
+ set { Dictionary [ "content " ] = value ; }
55
55
}
56
56
57
57
public IStringProperty KeywordsField
@@ -93,7 +93,7 @@ public class AttachmentPropertyDescriptor<T>
93
93
INumberProperty IAttachmentProperty . ContentLengthField { get ; set ; }
94
94
IStringProperty IAttachmentProperty . LanguageField { get ; set ; }
95
95
96
- private IDictionary Dictionary => Self . Fields ;
96
+ private IDictionary < PropertyName , IProperty > Dictionary => Self . Fields ?? ( Self . Fields = new Properties ( ) ) ;
97
97
98
98
public AttachmentPropertyDescriptor ( ) : base ( "attachment" ) { }
99
99
@@ -117,7 +117,7 @@ public AttachmentPropertyDescriptor<T> NameField(Func<StringPropertyDescriptor<T
117
117
SetMetadataField ( selector , "name" ) ;
118
118
119
119
public AttachmentPropertyDescriptor < T > FileField ( Func < StringPropertyDescriptor < T > , IStringProperty > selector ) =>
120
- SetMetadataField ( selector , "file " ) ;
120
+ SetMetadataField ( selector , "content " ) ;
121
121
122
122
public AttachmentPropertyDescriptor < T > AuthorField ( Func < StringPropertyDescriptor < T > , IStringProperty > selector ) =>
123
123
SetMetadataField ( selector , "author" ) ;
@@ -128,10 +128,18 @@ public AttachmentPropertyDescriptor<T> KeywordsField(Func<StringPropertyDescript
128
128
public AttachmentPropertyDescriptor < T > ContentTypeField ( Func < StringPropertyDescriptor < T > , IStringProperty > selector ) =>
129
129
SetMetadataField ( selector , "content_type" ) ;
130
130
131
+ [ Obsolete ( "Use ContentLengthField(Func<NumberPropertyDescriptor<T>, INumberProperty> selector)" ) ]
131
132
public AttachmentPropertyDescriptor < T > ContentLengthField ( Func < StringPropertyDescriptor < T > , IStringProperty > selector ) =>
132
133
SetMetadataField ( selector , "content_length" ) ;
133
134
135
+ public AttachmentPropertyDescriptor < T > ContentLengthField ( Func < NumberPropertyDescriptor < T > , INumberProperty > selector ) =>
136
+ SetMetadataField ( selector , "content_length" ) ;
137
+
138
+ [ Obsolete ( "Use LanguageField(Func<StringPropertyDescriptor<T>, IStringProperty> selector)" ) ]
134
139
public AttachmentPropertyDescriptor < T > LanguageField ( Func < NumberPropertyDescriptor < T > , INumberProperty > selector ) =>
135
140
SetMetadataField ( selector , "language" ) ;
141
+
142
+ public AttachmentPropertyDescriptor < T > LanguageField ( Func < StringPropertyDescriptor < T > , IStringProperty > selector ) =>
143
+ SetMetadataField ( selector , "language" ) ;
136
144
}
137
145
}
0 commit comments