Skip to content

Commit f367f50

Browse files
committed
Fix #2060: deprecate StringProperty
1 parent 11c6e57 commit f367f50

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

src/CodeGeneration/CodeGeneration.LowLevelClient/CodeGeneration.LowLevelClient.project.lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"locked": false,
3-
"version": 2,
3+
"version": 1,
44
"targets": {
55
".NETFramework,Version=v4.5": {},
66
".NETFramework,Version=v4.5/win": {}

src/CodeGeneration/Nest.Litterateur/Nest.Litterateur.project.lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"locked": false,
3-
"version": 2,
3+
"version": 1,
44
"targets": {
55
".NETFramework,Version=v4.5": {},
66
".NETFramework,Version=v4.5/win": {}

src/Elasticsearch.Net/Elasticsearch.Net.project.lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"locked": false,
3-
"version": 2,
3+
"version": 1,
44
"targets": {
55
".NETFramework,Version=v4.5": {},
66
".NETFramework,Version=v4.5/win": {}

src/Nest/Mapping/DynamicTemplate/SingleMapping.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ public class SingleMappingDescriptor<T> :
66
DescriptorBase<SingleMappingDescriptor<T>, IPropertiesDescriptor<T, IProperty>>, IPropertiesDescriptor<T, IProperty>
77
where T : class
88
{
9+
10+
[Obsolete("Only valid for indices created before Elasticsearch 5.0 and will be removed in the next major version. For newly created indices, use `text` or `keyword` instead.")]
911
public IProperty String(Func<StringPropertyDescriptor<T>, IStringProperty> selector) =>
1012
selector?.Invoke(new StringPropertyDescriptor<T>());
1113

@@ -60,4 +62,4 @@ public IProperty Generic(Func<GenericPropertyDescriptor<T>, IGenericProperty> se
6062
public IProperty Percolator(Func<PercolatorPropertyDescriptor<T>, IPercolatorProperty> selector) =>
6163
selector?.Invoke(new PercolatorPropertyDescriptor<T>());
6264
}
63-
}
65+
}

src/Nest/Mapping/Types/Core/String/StringProperty.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace Nest
55
{
66
[JsonObject(MemberSerialization.OptIn)]
7+
[Obsolete("Only valid for indices created before Elasticsearch 5.0 and will be removed in the next major version. For newly created indices, use `text` or `keyword` instead.")]
78
public interface IStringProperty : IDocValuesProperty
89
{
910
[JsonProperty("index")]
@@ -43,6 +44,7 @@ public interface IStringProperty : IDocValuesProperty
4344
IStringFielddata Fielddata { get; set; }
4445
}
4546

47+
[Obsolete("Only valid for indices created before Elasticsearch 5.0 and will be removed in the next major version. For newly created indices, use `text` or `keyword` instead.")]
4648
public class StringProperty : DocValuesPropertyBase, IStringProperty
4749
{
4850
public StringProperty() : base("string") { }
@@ -61,6 +63,7 @@ public StringProperty() : base("string") { }
6163
public IStringFielddata Fielddata { get; set; }
6264
}
6365

66+
[Obsolete("Only valid for indices created before Elasticsearch 5.0 and will be removed in the next major version. For newly created indices, use `text` or `keyword` instead.")]
6467
public class StringPropertyDescriptor<T>
6568
: DocValuesPropertyDescriptorBase<StringPropertyDescriptor<T>, IStringProperty, T>, IStringProperty
6669
where T : class

src/Nest/Mapping/Types/Properties.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public interface IPropertiesDescriptor<T, out TReturnType>
3737
where T : class
3838
where TReturnType : class
3939
{
40+
41+
[Obsolete("Only valid for indices created before Elasticsearch 5.0 and will be removed in the next major version. For newly created indices, use `text` or `keyword` instead.")]
4042
TReturnType String(Func<StringPropertyDescriptor<T>, IStringProperty> selector);
4143
TReturnType Text(Func<TextPropertyDescriptor<T>, ITextProperty> selector);
4244
TReturnType Keyword(Func<KeywordPropertyDescriptor<T>, IKeywordProperty> selector);
@@ -64,6 +66,8 @@ public class PropertiesDescriptor<T> : IsADictionaryDescriptorBase<PropertiesDes
6466
public PropertiesDescriptor() : base(new Properties<T>()) { }
6567
public PropertiesDescriptor(IProperties properties) : base(properties ?? new Properties<T>()) { }
6668

69+
70+
[Obsolete("Only valid for indices created before Elasticsearch 5.0 and will be removed in the next major version. For newly created indices, use `text` or `keyword` instead.")]
6771
public PropertiesDescriptor<T> String(Func<StringPropertyDescriptor<T>, IStringProperty> selector) => SetProperty(selector);
6872

6973
public PropertiesDescriptor<T> Text(Func<TextPropertyDescriptor<T>, ITextProperty> selector) => SetProperty(selector);

0 commit comments

Comments
 (0)