Skip to content

Commit 07fc265

Browse files
Stuart CamMpdreamz
authored andcommitted
Remove redundant code for GA release (#3067)
1 parent ee94c11 commit 07fc265

File tree

24 files changed

+25
-418
lines changed

24 files changed

+25
-418
lines changed

docs/query-dsl/full-text/query-string/query-string-usage.asciidoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ q
3131
.QuoteAnalyzer("quote-an")
3232
.AllowLeadingWildcard()
3333
.MaximumDeterminizedStates(2)
34-
.EnablePositionIncrements()
3534
.Escape()
3635
.FuzzyPrefixLength(2)
3736
.FuzzyMaxExpansions(3)
@@ -43,7 +42,6 @@ q
4342
.MinimumShouldMatch(2)
4443
.QuoteFieldSuffix("'")
4544
.Lenient()
46-
.Timezone("root")
4745
)
4846
----
4947

@@ -63,7 +61,6 @@ new QueryStringQuery
6361
QuoteAnalyzer = "quote-an",
6462
AllowLeadingWildcard = true,
6563
MaximumDeterminizedStates = 2,
66-
EnablePositionIncrements = true,
6764
Escape = true,
6865
FuzzyPrefixLength = 2,
6966
FuzzyMaxExpansions = 3,
@@ -75,7 +72,6 @@ new QueryStringQuery
7572
MinimumShouldMatch = 2,
7673
QuoteFieldSuffix = "'",
7774
Lenient = true,
78-
Timezone = "root"
7975
}
8076
----
8177

@@ -92,15 +88,13 @@ new QueryStringQuery
9288
"analyzer": "standard",
9389
"quote_analyzer": "quote-an",
9490
"allow_leading_wildcard": true,
95-
"enable_position_increments": true,
9691
"fuzzy_max_expansions": 3,
9792
"fuzziness": "AUTO",
9893
"fuzzy_prefix_length": 2,
9994
"analyze_wildcard": true,
10095
"max_determinized_states": 2,
10196
"minimum_should_match": 2,
10297
"lenient": true,
103-
"time_zone": "root",
10498
"fields": [
10599
"description",
106100
"myOtherField"

src/Nest/Aggregations/Bucket/GeoDistance/GeoDistanceAggregation.cs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ public interface IGeoDistanceAggregation : IBucketAggregation
2323
GeoDistanceType? DistanceType { get; set; }
2424

2525
[JsonProperty("ranges")]
26-
#pragma warning disable 618
27-
IEnumerable<IRange> Ranges { get; set; }
28-
#pragma warning restore 618
26+
IEnumerable<IAggregationRange> Ranges { get; set; }
27+
2928
}
3029

3130
public class GeoDistanceAggregation : BucketAggregationBase, IGeoDistanceAggregation
@@ -38,9 +37,7 @@ public class GeoDistanceAggregation : BucketAggregationBase, IGeoDistanceAggrega
3837

3938
public GeoDistanceType? DistanceType { get; set; }
4039

41-
#pragma warning disable 618
42-
public IEnumerable<IRange> Ranges { get; set; }
43-
#pragma warning restore 618
40+
public IEnumerable<IAggregationRange> Ranges { get; set; }
4441

4542
internal GeoDistanceAggregation() { }
4643

@@ -62,9 +59,7 @@ public class GeoDistanceAggregationDescriptor<T> :
6259

6360
GeoDistanceType? IGeoDistanceAggregation.DistanceType { get; set; }
6461

65-
#pragma warning disable 618
66-
IEnumerable<IRange> IGeoDistanceAggregation.Ranges { get; set; }
67-
#pragma warning restore 618
62+
IEnumerable<IAggregationRange> IGeoDistanceAggregation.Ranges { get; set; }
6863

6964
public GeoDistanceAggregationDescriptor<T> Field(Field field) => Assign(a => a.Field = field);
7065

@@ -78,9 +73,7 @@ public class GeoDistanceAggregationDescriptor<T> :
7873

7974
public GeoDistanceAggregationDescriptor<T> DistanceType(GeoDistanceType? geoDistance) => Assign(a => a.DistanceType = geoDistance);
8075

81-
#pragma warning disable 618
82-
public GeoDistanceAggregationDescriptor<T> Ranges(params Func<RangeDescriptor, IRange>[] ranges) =>
83-
Assign(a => a.Ranges = ranges?.Select(r => r(new RangeDescriptor())));
84-
#pragma warning restore 618
76+
public GeoDistanceAggregationDescriptor<T> Ranges(params Func<AggregationRangeDescriptor, IAggregationRange>[] ranges) =>
77+
Assign(a => a.Ranges = ranges?.Select(r => r(new AggregationRangeDescriptor())));
8578
}
8679
}

src/Nest/Aggregations/Bucket/Range/RangeAggregation.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,14 @@ public interface IRangeAggregation : IBucketAggregation
1717
IScript Script { get; set; }
1818

1919
[JsonProperty("ranges")]
20-
#pragma warning disable 618
21-
IEnumerable<IRange> Ranges { get; set; }
22-
#pragma warning restore 618
20+
IEnumerable<IAggregationRange> Ranges { get; set; }
2321
}
2422

2523
public class RangeAggregation : BucketAggregationBase, IRangeAggregation
2624
{
2725
public Field Field { get; set; }
2826
public IScript Script { get; set; }
29-
#pragma warning disable 618
30-
public IEnumerable<IRange> Ranges { get; set; }
31-
#pragma warning restore 618
32-
27+
public IEnumerable<IAggregationRange> Ranges { get; set; }
3328
internal RangeAggregation() { }
3429

3530
public RangeAggregation(string name) : base(name) { }
@@ -45,9 +40,7 @@ public class RangeAggregationDescriptor<T>
4540

4641
IScript IRangeAggregation.Script { get; set; }
4742

48-
#pragma warning disable 618
49-
IEnumerable<IRange> IRangeAggregation.Ranges { get; set; }
50-
#pragma warning restore 618
43+
IEnumerable<IAggregationRange> IRangeAggregation.Ranges { get; set; }
5144

5245
public RangeAggregationDescriptor<T> Field(Field field) => Assign(a => a.Field = field);
5346

@@ -58,9 +51,7 @@ public class RangeAggregationDescriptor<T>
5851
public RangeAggregationDescriptor<T> Script(Func<ScriptDescriptor, IScript> scriptSelector) =>
5952
Assign(a => a.Script = scriptSelector?.Invoke(new ScriptDescriptor()));
6053

61-
#pragma warning disable 618
62-
public RangeAggregationDescriptor<T> Ranges(params Func<RangeDescriptor, IRange>[] ranges) =>
63-
Assign(a => a.Ranges = ranges.Select(r => r(new RangeDescriptor())));
64-
#pragma warning restore 618
54+
public RangeAggregationDescriptor<T> Ranges(params Func<AggregationRangeDescriptor, IAggregationRange>[] ranges) =>
55+
Assign(a => a.Ranges = ranges.Select(r => r(new AggregationRangeDescriptor())));
6556
}
6657
}

src/Nest/CommonAbstractions/SerializationBehavior/ElasticContractResolver.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,7 @@ protected bool ShouldSerializeRouting(object o, JsonProperty prop)
230230
private static readonly StringEnumConverter StringEnumConverter = new StringEnumConverter();
231231
private static readonly StringTimeSpanConverter StringTimeSpanConverter = new StringTimeSpanConverter();
232232
private static readonly MachineLearningDateTimeConverter MachineLearningDateTimeConverter = new MachineLearningDateTimeConverter();
233-
#pragma warning disable 618
234-
private static readonly Type[] StringSignalTypes = {typeof(KeywordAttribute), typeof(StringAttribute), typeof(TextAttribute)};
235-
#pragma warning restore 618
233+
private static readonly Type[] StringSignalTypes = {typeof(KeywordAttribute), typeof(TextAttribute)};
236234
private static void ApplyBuildInSerializers(MemberInfo member, JsonProperty property)
237235
{
238236
var attributes = member.GetCustomAttributes().ToList();

src/Nest/CommonOptions/Range/AggregationRange.cs

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ namespace Nest
99
/// part of your document please use explicit range class e.g DateRange, FloatRange etc
1010
/// </summary>
1111
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
12-
[JsonConverter(typeof(ReadAsTypeJsonConverter<Range>))]
13-
[Obsolete("Renamed to IAggregationRange scheduled for removal in 6.0")]
14-
public interface IRange
12+
[JsonConverter(typeof(ReadAsTypeJsonConverter<AggregationRange>))]
13+
public interface IAggregationRange
1514
{
1615
[JsonProperty("from")]
1716
double? From { get; set; }
@@ -23,42 +22,23 @@ public interface IRange
2322
string Key { get; set; }
2423
}
2524

26-
/// <summary>
27-
/// Range that defines a bucket for either the <see cref="RangeAggregation"/> or
28-
/// <see cref="GeoDistanceAggregation"/>. If you are looking to store ranges as
29-
/// part of your document please use explicit range class e.g DateRange, FloatRange etc
30-
/// </summary>
31-
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
32-
[JsonConverter(typeof(ReadAsTypeJsonConverter<AggregationRange>))]
33-
#pragma warning disable 618
34-
public interface IAggregationRange : IRange {}
35-
3625
/// <inheritdoc/>
37-
[Obsolete("Renamed to AggregationRange, scheduled for removal in 6.0")]
38-
public class Range : IRange
26+
public class AggregationRange : IAggregationRange
3927
{
4028
public double? From { get; set; }
4129
public double? To { get; set; }
4230
public string Key { get; set; }
4331
}
4432

4533
/// <inheritdoc/>
46-
public class AggregationRange : Range, IAggregationRange { }
47-
48-
/// <inheritdoc/>
49-
[Obsolete("Renamed to AggregationRangeDescriptor, scheduled for removal in 6.0")]
50-
public class RangeDescriptor : DescriptorBase<RangeDescriptor, IRange>, IRange
34+
public class AggregationRangeDescriptor : DescriptorBase<AggregationRangeDescriptor, IAggregationRange>, IAggregationRange
5135
{
52-
double? IRange.From { get; set; }
53-
string IRange.Key { get; set; }
54-
double? IRange.To { get; set; }
36+
double? IAggregationRange.From { get; set; }
37+
string IAggregationRange.Key { get; set; }
38+
double? IAggregationRange.To { get; set; }
5539

56-
public RangeDescriptor Key(string key) => Assign(a => a.Key = key);
57-
public RangeDescriptor From(double? from) => Assign(a => a.From = from);
58-
public RangeDescriptor To(double? to) => Assign(a => a.To = to);
40+
public AggregationRangeDescriptor Key(string key) => Assign(a => a.Key = key);
41+
public AggregationRangeDescriptor From(double? from) => Assign(a => a.From = from);
42+
public AggregationRangeDescriptor To(double? to) => Assign(a => a.To = to);
5943
}
60-
61-
/// <inheritdoc/>
62-
public class AggregationRangeDescriptor : RangeDescriptor, IAggregationRange { }
63-
#pragma warning restore 618
6444
}

src/Nest/CommonOptions/Scripting/ScriptBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public class ScriptDescriptor : DescriptorBase<ScriptDescriptor, IDescriptor>
103103
{
104104
public IndexedScriptDescriptor Id(string id) => new IndexedScriptDescriptor(id);
105105

106-
[Obsolete("Use Id(). Indexed() sets a property named id, which is confusing. Will be removed in the next major version")]
106+
[Obsolete("Use Id(). Indexed() sets a property named id, which is confusing. Will be removed in NEST 7.x")]
107107
public IndexedScriptDescriptor Indexed(string id) => new IndexedScriptDescriptor(id);
108108

109109
[Obsolete("Use Source(). Inline() is deprecated and scheduled to be removed in Elasticsearch 7.0")]

src/Nest/Indices/MappingManagement/GetMapping/GetMappingResponse.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ public class GetMappingResponse : DictionaryResponseBase<IndexName, IndexMapping
4646
[Obsolete("Renamed to Indices, will be deleted from NEST 7.x")]
4747
public IReadOnlyDictionary<IndexName, IndexMappings> Mappings => Indices;
4848

49-
[Obsolete("Use GetMappingFor explicitly instead this is a leaky abstraction that returns the mapping of the first index's first type on the response")]
49+
[Obsolete("Recommended to use GetMappingFor, this is a leaky abstraction that returns the mapping of the first index's first type on the response")]
5050
public ITypeMapping Mapping => this.Indices.FirstOrDefault().Value?.Mappings?.FirstOrDefault().Value;
5151

52-
5352
public void Accept(IMappingVisitor visitor)
5453
{
5554
var walker = new MappingWalker(visitor);

src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ internal PutMappingRequest() { }
2727
/// <inheritdoc/>
2828
public Union<bool, DynamicMapping> Dynamic { get; set; }
2929
/// <inheritdoc/>
30-
public string Analyzer { get; set; }
31-
/// <inheritdoc/>
32-
public string SearchAnalyzer { get; set; }
33-
/// <inheritdoc/>
3430
public IFieldNamesField FieldNamesField { get; set; }
3531
/// <inheritdoc/>
3632
public IIndexField IndexField { get; set; }
@@ -63,10 +59,6 @@ public PutMappingRequest() : this(typeof(T), typeof(T)) { }
6359
/// <inheritdoc/>
6460
public Union<bool, DynamicMapping> Dynamic { get; set; }
6561
/// <inheritdoc/>
66-
public string Analyzer { get; set; }
67-
/// <inheritdoc/>
68-
public string SearchAnalyzer { get; set; }
69-
/// <inheritdoc/>
7062
public IFieldNamesField FieldNamesField { get; set; }
7163
/// <inheritdoc/>
7264
public IIndexField IndexField { get; set; }
@@ -95,8 +87,6 @@ public PutMappingDescriptor(IndexName index, TypeName type) : base(r=>r.Required
9587
IAllField ITypeMapping.AllField { get; set; }
9688
bool? ITypeMapping.DateDetection { get; set; }
9789
IEnumerable<string> ITypeMapping.DynamicDateFormats { get; set; }
98-
string ITypeMapping.Analyzer { get; set; }
99-
string ITypeMapping.SearchAnalyzer { get; set; }
10090
IDynamicTemplateContainer ITypeMapping.DynamicTemplates { get; set; }
10191
Union<bool, DynamicMapping> ITypeMapping.Dynamic { get; set; }
10292
IFieldNamesField ITypeMapping.FieldNamesField { get; set; }
@@ -126,14 +116,6 @@ public PutMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int maxR
126116
/// <inheritdoc/>
127117
public PutMappingDescriptor<T> Dynamic(bool? dynamic = true) => Assign(a => a.Dynamic = dynamic);
128118

129-
#pragma warning disable 618
130-
/// <inheritdoc/>
131-
public PutMappingDescriptor<T> Analyzer(string analyzer) => Assign(a => a.Analyzer = analyzer);
132-
133-
/// <inheritdoc/>
134-
public PutMappingDescriptor<T> SearchAnalyzer(string searchAnalyzer) => Assign(a => a.SearchAnalyzer = searchAnalyzer);
135-
#pragma warning restore 618
136-
137119
/// <inheritdoc/>
138120
public PutMappingDescriptor<T> AllField(Func<AllFieldDescriptor, IAllField> allFieldSelector) => Assign(a => a.AllField = allFieldSelector?.Invoke(new AllFieldDescriptor()));
139121

src/Nest/Mapping/DynamicTemplate/SingleMapping.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ namespace Nest
66
{
77
public class SingleMappingSelector<T> : SelectorBase<IProperty>, IPropertiesDescriptor<T, IProperty> where T : class
88
{
9-
[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.")]
10-
public IProperty String(Func<StringPropertyDescriptor<T>, IStringProperty> selector) =>
11-
selector?.Invoke(new StringPropertyDescriptor<T>());
12-
139
public IProperty Text(Func<TextPropertyDescriptor<T>, ITextProperty> selector) =>
1410
selector?.Invoke(new TextPropertyDescriptor<T>());
1511

src/Nest/Mapping/TypeMapping.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ public interface ITypeMapping
1717
[JsonProperty("numeric_detection")]
1818
bool? NumericDetection { get; set; }
1919

20-
[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.")]
21-
[JsonProperty("analyzer")]
22-
string Analyzer { get; set; }
23-
24-
[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.")]
25-
[JsonProperty("search_analyzer")]
26-
string SearchAnalyzer { get; set; }
27-
2820
[JsonProperty("_source")]
2921
ISourceField SourceField { get; set; }
3022

@@ -82,12 +74,6 @@ public class TypeMapping : ITypeMapping
8274
/// <inheritdoc/>
8375
public IRoutingField RoutingField { get; set; }
8476
/// <inheritdoc/>
85-
[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.")]
86-
public string Analyzer { get; set; }
87-
/// <inheritdoc/>
88-
[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.")]
89-
public string SearchAnalyzer { get; set; }
90-
/// <inheritdoc/>
9177
public ISizeField SizeField { get; set; }
9278
/// <inheritdoc/>
9379
public ISourceField SourceField { get; set; }
@@ -108,10 +94,6 @@ public class TypeMappingDescriptor<T> : DescriptorBase<TypeMappingDescriptor<T>,
10894
bool? ITypeMapping.NumericDetection { get; set; }
10995
IProperties ITypeMapping.Properties { get; set; }
11096
IRoutingField ITypeMapping.RoutingField { get; set; }
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.")]
112-
string ITypeMapping.Analyzer { get; set; }
113-
[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.")]
114-
string ITypeMapping.SearchAnalyzer { get; set; }
11597
ISizeField ITypeMapping.SizeField { get; set; }
11698
ISourceField ITypeMapping.SourceField { get; set; }
11799

@@ -144,14 +126,6 @@ public TypeMappingDescriptor<T> AutoMap<TDocument>(IPropertyVisitor visitor = nu
144126
/// <inheritdoc/>
145127
public TypeMappingDescriptor<T> Dynamic(bool dynamic = true) => Assign(a => a.Dynamic = dynamic);
146128

147-
/// <inheritdoc/>
148-
[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.")]
149-
public TypeMappingDescriptor<T> Analyzer(string analyzer) => Assign(a => a.Analyzer = analyzer);
150-
151-
/// <inheritdoc/>
152-
[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.")]
153-
public TypeMappingDescriptor<T> SearchAnalyzer(string searchAnalyzer)=> Assign(a => a.SearchAnalyzer = searchAnalyzer);
154-
155129
/// <inheritdoc/>
156130
public TypeMappingDescriptor<T> AllField(Func<AllFieldDescriptor, IAllField> allFieldSelector) => Assign(a => a.AllField = allFieldSelector?.Invoke(new AllFieldDescriptor()));
157131

0 commit comments

Comments
 (0)