You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mark type level analyzers as obsolete and add a convenience method fo… (#2506)
* Mark type level analyzers as obsolete and add a convenience method for setting an index-level default
* remove Default()
Conflicts:
src/Tests/Analysis/Analyzers/AnalyzerUsageTests.cs
Copy file name to clipboardExpand all lines: src/Nest/Mapping/TypeMapping.cs
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,11 @@ public interface ITypeMapping
25
25
[JsonProperty("include_in_all")]
26
26
bool?IncludeInAll{get;set;}
27
27
28
+
[Obsolete("Scheduled to be removed in 6.0. Default analyzers can no longer be specified at the type level. Use an index or field level analyzer instead.")]
28
29
[JsonProperty("analyzer")]
29
30
stringAnalyzer{get;set;}
30
31
32
+
[Obsolete("Scheduled to be removed in 6.0. Default analyzers can no longer be specified at the type level. Use an index or field level analyzer instead.")]
31
33
[JsonProperty("search_analyzer")]
32
34
stringSearchAnalyzer{get;set;}
33
35
@@ -79,8 +81,6 @@ public class TypeMapping : ITypeMapping
79
81
/// <inheritdoc/>
80
82
publicIAllFieldAllField{get;set;}
81
83
/// <inheritdoc/>
82
-
publicstringAnalyzer{get;set;}
83
-
/// <inheritdoc/>
84
84
publicbool?DateDetection{get;set;}
85
85
/// <inheritdoc/>
86
86
publicDynamicMapping?Dynamic{get;set;}
@@ -105,6 +105,10 @@ public class TypeMapping : ITypeMapping
105
105
/// <inheritdoc/>
106
106
publicIRoutingFieldRoutingField{get;set;}
107
107
/// <inheritdoc/>
108
+
[Obsolete("Scheduled to be removed in 6.0. Default analyzers can no longer be specified at the type level. Use an index or field level analyzer instead.")]
109
+
publicstringAnalyzer{get;set;}
110
+
/// <inheritdoc/>
111
+
[Obsolete("Scheduled to be removed in 6.0. Default analyzers can no longer be specified at the type level. Use an index or field level analyzer instead.")]
108
112
publicstringSearchAnalyzer{get;set;}
109
113
/// <inheritdoc/>
110
114
publicISizeFieldSizeField{get;set;}
@@ -126,7 +130,6 @@ public class TypeMappingDescriptor<T> : DescriptorBase<TypeMappingDescriptor<T>,
126
130
whereT:class
127
131
{
128
132
IAllFieldITypeMapping.AllField{get;set;}
129
-
stringITypeMapping.Analyzer{get;set;}
130
133
bool?ITypeMapping.DateDetection{get;set;}
131
134
bool?ITypeMapping.IncludeInAll{get;set;}
132
135
DynamicMapping?ITypeMapping.Dynamic{get;set;}
@@ -139,6 +142,9 @@ public class TypeMappingDescriptor<T> : DescriptorBase<TypeMappingDescriptor<T>,
139
142
IParentFieldITypeMapping.ParentField{get;set;}
140
143
IPropertiesITypeMapping.Properties{get;set;}
141
144
IRoutingFieldITypeMapping.RoutingField{get;set;}
145
+
[Obsolete("Scheduled to be removed in 6.0. Default analyzers can no longer be specified at the type level. Use an index or field level analyzer instead.")]
146
+
stringITypeMapping.Analyzer{get;set;}
147
+
[Obsolete("Scheduled to be removed in 6.0. Default analyzers can no longer be specified at the type level. Use an index or field level analyzer instead.")]
142
148
stringITypeMapping.SearchAnalyzer{get;set;}
143
149
ISizeFieldITypeMapping.SizeField{get;set;}
144
150
ISourceFieldITypeMapping.SourceField{get;set;}
@@ -177,9 +183,11 @@ public TypeMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int max
[Obsolete("Scheduled to be removed in 6.0. Default analyzers can no longer be specified at the type level. Use an index or field level analyzer instead.")]
[Obsolete("Scheduled to be removed in 6.0. Default analyzers can no longer be specified at the type level. Use an index or field level analyzer instead.")]
0 commit comments