Skip to content

Commit 3d77d19

Browse files
authored
Fix/obsolete and removed (elastic#3044)
* remove unused enum FinalDecision, removed obsolete in 5.x properties from simple query string * remove indices query * remove template query * Span near removed properties * remove throttle time from store stats
1 parent 6014c9c commit 3d77d19

File tree

23 files changed

+12
-539
lines changed

23 files changed

+12
-539
lines changed

src/Nest/Cluster/ClusterAllocationExplain/ClusterAllocationExplainResponse.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -201,20 +201,6 @@ public enum Decision
201201
No
202202
}
203203

204-
[JsonConverter(typeof(StringEnumConverter))]
205-
[Obsolete("Removed in Elasticsearch 5.2")]
206-
public enum FinalDecision
207-
{
208-
[EnumMember(Value = "YES")]
209-
Yes,
210-
211-
[EnumMember(Value = "NO")]
212-
No,
213-
214-
[EnumMember(Value = "ALREADY_ASSIGNED")]
215-
AlreadyAssigned
216-
}
217-
218204
[JsonConverter(typeof(StringEnumConverter))]
219205
public enum StoreCopy
220206
{

src/Nest/CommonAbstractions/SerializationBehavior/ElasticContractResolver.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ protected static bool ShouldSerializeQueryContainer(object o, JsonProperty prop)
164164
{
165165
if (o == null) return false;
166166
if (!(prop.ValueProvider.GetValue(o) is QueryContainer q)) return false;
167-
if (q.IsWritable) return true;
168-
var nq = q as NoMatchQueryContainer;
169-
return nq?.Shortcut != null;
167+
return q.IsWritable;
170168
}
171169

172170
protected static bool ShouldSerializeQueryContainers(object o, JsonProperty prop)

src/Nest/CommonOptions/Stats/StoreStats.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ public class StoreStats
1111
[JsonProperty("size_in_bytes")]
1212
public double SizeInBytes { get; set; }
1313

14-
[JsonProperty("throttle_time_in_millis")]
15-
public long ThrottleTimeInMilliseconds { get; set; }
1614
}
1715

1816
}

src/Nest/QueryDsl/Abstractions/Container/IQueryContainer.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,9 @@ public interface IQueryContainer
130130
[JsonProperty("nested")]
131131
INestedQuery Nested { get; set; }
132132

133-
[Obsolete("Deprecated. You can specify _index on the query to target specific indices")]
134-
[JsonProperty("indices")]
135-
IIndicesQuery Indices { get; set; }
136-
137133
[JsonProperty("function_score")]
138134
IFunctionScoreQuery FunctionScore { get; set; }
139135

140-
#pragma warning disable 618
141-
[JsonProperty("template")]
142-
ITemplateQuery Template { get; set; }
143-
#pragma warning restore 618
144-
145136
[JsonProperty("geo_bounding_box")]
146137
IGeoBoundingBoxQuery GeoBoundingBox { get; set; }
147138

src/Nest/QueryDsl/Abstractions/Container/QueryContainer-Assignments.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ public partial class QueryContainer : IQueryContainer, IDescriptor
4242
private ISpanFieldMaskingQuery _spanFieldMasking;
4343
private INestedQuery _nested;
4444

45-
#pragma warning disable 618
46-
private IIndicesQuery _indices;
47-
#pragma warning restore 618
4845
private IFunctionScoreQuery _functionScore;
49-
#pragma warning disable 618
50-
private ITemplateQuery _template;
51-
#pragma warning restore 618
5246
private IGeoBoundingBoxQuery _geoBoundingBox;
5347
private IGeoDistanceQuery _geoDistance;
5448
private IGeoPolygonQuery _geoPolygon;
@@ -108,13 +102,7 @@ private T Set<T>(T value) where T : IQuery
108102
ISpanMultiTermQuery IQueryContainer.SpanMultiTerm { get { return _spanMultiTerm; } set { _spanMultiTerm = Set(value); } }
109103
ISpanFieldMaskingQuery IQueryContainer.SpanFieldMasking { get { return _spanFieldMasking; } set { _spanFieldMasking = Set(value); } }
110104
INestedQuery IQueryContainer.Nested { get { return _nested; } set { _nested = Set(value); } }
111-
#pragma warning disable 618
112-
IIndicesQuery IQueryContainer.Indices { get { return _indices; } set { _indices = Set(value); } }
113-
#pragma warning restore 618
114105
IFunctionScoreQuery IQueryContainer.FunctionScore { get { return _functionScore; } set { _functionScore = Set(value); } }
115-
#pragma warning disable 618
116-
ITemplateQuery IQueryContainer.Template { get { return _template; } set { _template = Set(value); } }
117-
#pragma warning restore 618
118106
IGeoBoundingBoxQuery IQueryContainer.GeoBoundingBox { get { return _geoBoundingBox; } set { _geoBoundingBox = Set(value); } }
119107
IGeoDistanceQuery IQueryContainer.GeoDistance { get { return _geoDistance; } set { _geoDistance = Set(value); } }
120108
IGeoPolygonQuery IQueryContainer.GeoPolygon { get { return _geoPolygon; } set { _geoPolygon = Set(value); } }

src/Nest/QueryDsl/Abstractions/Container/QueryContainerDescriptor.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ public QueryContainer Conditionless(Func<ConditionlessQueryDescriptor<T>, ICondi
129129
return query?.Query ?? query?.Fallback;
130130
}
131131

132-
/// <summary>
133-
/// The indices query can be used when executed across multiple indices, allowing to have a query that executes
134-
/// only when executed on an index that matches a specific list of indices, and another query that executes
135-
/// when it is executed on an index that does not match the listed indices.
136-
/// </summary>
137-
[Obsolete("Deprecated. You can specify _index on the query to target specific indices")]
138-
public QueryContainer Indices(Func<IndicesQueryDescriptor<T>, IIndicesQuery> selector) =>
139-
WrapInContainer(selector, (query, container) => container.Indices = query);
140-
141132
/// <summary>
142133
/// Matches documents with fields that have terms within a certain numeric range.
143134
/// </summary>
@@ -491,14 +482,6 @@ public QueryContainer Regexp(Func<RegexpQueryDescriptor<T>, IRegexpQuery> select
491482
public QueryContainer FunctionScore(Func<FunctionScoreQueryDescriptor<T>, IFunctionScoreQuery> selector) =>
492483
WrapInContainer(selector, (query, container) => container.FunctionScore = query);
493484

494-
/// <summary>
495-
/// A query that accepts a query template and a map of key/value pairs to fill in template parameters.
496-
/// Templating is based on Mustache.
497-
/// </summary>
498-
[Obsolete("Deprecated in 5.0.0. Use Search Template API instead")]
499-
public QueryContainer Template(Func<TemplateQueryDescriptor<T>, ITemplateQuery> selector) =>
500-
WrapInContainer(selector, (query, container) => container.Template = query);
501-
502485
public QueryContainer Script(Func<ScriptQueryDescriptor<T>, IScriptQuery> selector) =>
503486
WrapInContainer(selector, (query, container) => container.Script = query);
504487

src/Nest/QueryDsl/Compound/Indices/IndicesQuery.cs

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/Nest/QueryDsl/Compound/Indices/NoMatchQueryJsonConverter.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Nest/QueryDsl/Compound/Indices/NoMatchShortcut.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Nest/QueryDsl/FullText/SimpleQueryString/SimpleQueryStringQuery.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ public interface ISimpleQueryStringQuery : IQuery
2222
[JsonProperty("flags")]
2323
SimpleQueryStringFlags? Flags { get; set; }
2424

25-
[JsonProperty("locale")]
26-
[Obsolete("Deprecated in Elasticsearch 5.1.1. Can be performed by the analyzer applied")]
27-
string Locale { get; set; }
28-
29-
[JsonProperty("lowercase_expanded_terms")]
30-
[Obsolete("Deprecated in Elasticsearch 5.1.1. Can be performed by the analyzer applied")]
31-
bool? LowercaseExpandedTerms { get; set; }
32-
3325
[JsonProperty("lenient")]
3426
bool? Lenient { get; set; }
3527

@@ -51,10 +43,6 @@ public class SimpleQueryStringQuery : QueryBase, ISimpleQueryStringQuery
5143
public string Analyzer { get; set; }
5244
public Operator? DefaultOperator { get; set; }
5345
public SimpleQueryStringFlags? Flags { get; set; }
54-
[Obsolete("Deprecated in Elasticsearch 5.1.1. Can be performed by the analyzer applied")]
55-
public string Locale { get; set; }
56-
[Obsolete("Deprecated in Elasticsearch 5.1.1. Can be performed by the analyzer applied")]
57-
public bool? LowercaseExpandedTerms { get; set; }
5846
public bool? Lenient { get; set; }
5947
public bool? AnalyzeWildcard { get; set; }
6048
public MinimumShouldMatch MinimumShouldMatch { get; set; }
@@ -74,10 +62,6 @@ public class SimpleQueryStringQueryDescriptor<T>
7462
string ISimpleQueryStringQuery.Analyzer { get; set; }
7563
Operator? ISimpleQueryStringQuery.DefaultOperator { get; set; }
7664
SimpleQueryStringFlags? ISimpleQueryStringQuery.Flags { get; set; }
77-
[Obsolete("Deprecated in Elasticsearch 5.1.1. Can be performed by the analyzer applied")]
78-
string ISimpleQueryStringQuery.Locale { get; set; }
79-
[Obsolete("Deprecated in Elasticsearch 5.1.1. Can be performed by the analyzer applied")]
80-
bool? ISimpleQueryStringQuery.LowercaseExpandedTerms { get; set; }
8165
bool? ISimpleQueryStringQuery.AnalyzeWildcard { get; set; }
8266
bool? ISimpleQueryStringQuery.Lenient { get; set; }
8367
MinimumShouldMatch ISimpleQueryStringQuery.MinimumShouldMatch { get; set; }
@@ -96,13 +80,6 @@ public SimpleQueryStringQueryDescriptor<T> Fields(Func<FieldsDescriptor<T>, IPro
9680

9781
public SimpleQueryStringQueryDescriptor<T> Flags(SimpleQueryStringFlags? flags) => Assign(a => a.Flags = flags);
9882

99-
[Obsolete("Deprecated in Elasticsearch 5.1.1. Can be performed by the analyzer applied")]
100-
public SimpleQueryStringQueryDescriptor<T> Locale(string locale) => Assign(a => a.Locale = locale);
101-
102-
[Obsolete("Deprecated in Elasticsearch 5.1.1. Can be performed by the analyzer applied")]
103-
public SimpleQueryStringQueryDescriptor<T> LowercaseExpandedTerms(bool? lowercaseExpandedTerms = true) =>
104-
Assign(a => a.LowercaseExpandedTerms = lowercaseExpandedTerms);
105-
10683
public SimpleQueryStringQueryDescriptor<T> AnalyzeWildcard(bool? analyzeWildcard = true) =>
10784
Assign(a => a.AnalyzeWildcard = analyzeWildcard);
10885

0 commit comments

Comments
 (0)