Skip to content

Commit 76c0196

Browse files
committed
bwc for IndicesPutAliasForAll, removed yaml test for now (need to regenerate later)
1 parent 3ff3bdd commit 76c0196

File tree

4 files changed

+72
-546
lines changed

4 files changed

+72
-546
lines changed

src/Elasticsearch.Net/Obsolete/IndicesPutAlias.cs

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,28 @@ public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesPutAliasAsyn
4343
return client.IndicesPutAliasAsync(index, name, selector);
4444
}
4545

46-
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
46+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
4747
public static ElasticsearchResponse<T> IndicesPutAliasForAll<T>(this IElasticsearchClient client, string name, object body, Func<IndicesPutAliasRequestParameters, IndicesPutAliasRequestParameters> requestParameters = null)
4848
{
49-
var selector = Obsolete.UpCastSelector<IndicesPutAliasRequestParameters, PutAliasRequestParameters>(requestParameters);
50-
return client.IndicesPutAliasForAll<T>(name, selector);
49+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
5150
}
5251

53-
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
52+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
5453
public static Task<ElasticsearchResponse<T>> IndicesPutAliasForAllAsync<T>(this IElasticsearchClient client, string name, object body, Func<IndicesPutAliasRequestParameters, IndicesPutAliasRequestParameters> requestParameters = null)
5554
{
56-
var selector = Obsolete.UpCastSelector<IndicesPutAliasRequestParameters, PutAliasRequestParameters>(requestParameters);
57-
return client.IndicesPutAliasForAllAsync<T>(name, selector);
55+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
5856
}
5957

60-
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
58+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
6159
public static ElasticsearchResponse<DynamicDictionary> IndicesPutAliasForAll(this IElasticsearchClient client, string name, object body, Func<IndicesPutAliasRequestParameters, IndicesPutAliasRequestParameters> requestParameters = null)
6260
{
63-
var selector = Obsolete.UpCastSelector<IndicesPutAliasRequestParameters, PutAliasRequestParameters>(requestParameters);
64-
return client.IndicesPutAliasForAll(name, selector);
61+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
6562
}
6663

67-
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
64+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
6865
public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesPutAliasForAllAsync(this IElasticsearchClient client, string name, object body, Func<IndicesPutAliasRequestParameters, IndicesPutAliasRequestParameters> requestParameters = null)
6966
{
70-
var selector = Obsolete.UpCastSelector<IndicesPutAliasRequestParameters, PutAliasRequestParameters>(requestParameters);
71-
return client.IndicesPutAliasForAllAsync(name, selector);
67+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
7268
}
7369

7470
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
@@ -99,32 +95,83 @@ public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesPutAliasPost
9995
return client.IndicesPutAliasPostAsync(index, name, selector);
10096
}
10197

102-
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
98+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
10399
public static ElasticsearchResponse<T> IndicesPutAliasPostForAll<T>(this IElasticsearchClient client, string name, object body, Func<IndicesPutAliasRequestParameters, IndicesPutAliasRequestParameters> requestParameters = null)
104100
{
105-
var selector = Obsolete.UpCastSelector<IndicesPutAliasRequestParameters, PutAliasRequestParameters>(requestParameters);
106-
return client.IndicesPutAliasForAll<T>(name, selector);
101+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
107102
}
108103

109-
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
104+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
110105
public static Task<ElasticsearchResponse<T>> IndicesPutAliasPostForAllAsync<T>(this IElasticsearchClient client, string name, object body, Func<IndicesPutAliasRequestParameters, IndicesPutAliasRequestParameters> requestParameters = null)
111106
{
112-
var selector = Obsolete.UpCastSelector<IndicesPutAliasRequestParameters, PutAliasRequestParameters>(requestParameters);
113-
return client.IndicesPutAliasForAllAsync<T>(name, selector);
107+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
114108
}
115109

116-
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
110+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
117111
public static ElasticsearchResponse<DynamicDictionary> IndicesPutAliasPostForAll(this IElasticsearchClient client, string name, object body, Func<IndicesPutAliasRequestParameters, IndicesPutAliasRequestParameters> requestParameters = null)
118112
{
119-
var selector = Obsolete.UpCastSelector<IndicesPutAliasRequestParameters, PutAliasRequestParameters>(requestParameters);
120-
return client.IndicesPutAliasForAll(name, selector);
113+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
121114
}
122115

123-
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of PutAliasRequestParameters")]
116+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
124117
public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesPutAliasPostForAllAsync(this IElasticsearchClient client, string name, object body, Func<IndicesPutAliasRequestParameters, IndicesPutAliasRequestParameters> requestParameters = null)
125118
{
126-
var selector = Obsolete.UpCastSelector<IndicesPutAliasRequestParameters, PutAliasRequestParameters>(requestParameters);
127-
return client.IndicesPutAliasForAllAsync(name, selector);
119+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
120+
}
121+
122+
123+
// resembles 1.5 removals, these Obsoletes will throw compiler errors
124+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
125+
public static ElasticsearchResponse<T> IndicesPutAliasForAll<T>(this IElasticsearchClient client, string name, object body, Func<PutAliasRequestParameters, PutAliasRequestParameters> requestParameters = null)
126+
{
127+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
128128
}
129+
130+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
131+
public static Task<ElasticsearchResponse<T>> IndicesPutAliasForAllAsync<T>(this IElasticsearchClient client,string name, object body, Func<PutAliasRequestParameters, PutAliasRequestParameters> requestParameters = null)
132+
{
133+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
134+
}
135+
136+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
137+
public static ElasticsearchResponse<DynamicDictionary> IndicesPutAliasForAll(this IElasticsearchClient client,string name, object body, Func<PutAliasRequestParameters, PutAliasRequestParameters> requestParameters = null)
138+
{
139+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
140+
}
141+
142+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
143+
public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesPutAliasForAllAsync(this IElasticsearchClient client,string name, object body, Func<PutAliasRequestParameters, PutAliasRequestParameters> requestParameters = null)
144+
{
145+
throw new NotImplementedException("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
146+
}
147+
148+
149+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
150+
public static ElasticsearchResponse<T> IndicesPutAliasPostForAll<T>(this IElasticsearchClient client,string name, object body, Func<PutAliasRequestParameters, PutAliasRequestParameters> requestParameters = null)
151+
{
152+
throw new NotImplementedException("IndicesPostAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
153+
}
154+
155+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
156+
public static Task<ElasticsearchResponse<T>> IndicesPutAliasPostForAllAsync<T>(this IElasticsearchClient client,string name, object body, Func<PutAliasRequestParameters, PutAliasRequestParameters> requestParameters = null)
157+
{
158+
throw new NotImplementedException("IndicesPostAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
159+
}
160+
161+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
162+
public static ElasticsearchResponse<DynamicDictionary> IndicesPutAliasPostForAll(this IElasticsearchClient client,string name, object body, Func<PutAliasRequestParameters, PutAliasRequestParameters> requestParameters = null)
163+
{
164+
throw new NotImplementedException("IndicesPostAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
165+
}
166+
167+
[Obsolete("IndicesPutAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now", error: true)]
168+
public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesPutAliasPostForAllAsync(this IElasticsearchClient client,string name, object body, Func<PutAliasRequestParameters, PutAliasRequestParameters> requestParameters = null)
169+
{
170+
throw new NotImplementedException("IndicesPostAlias since elasticsearch 1.5 needs an explicit index name (using _all or * for all), even if your on an older es version we urge you to move over now");
171+
}
172+
173+
174+
175+
129176
}
130177
}

src/Tests/Elasticsearch.Net.Integration.Yaml/Elasticsearch.Net.Integration.Yaml.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@
137137
<Compile Include="indices.clear_cache\10_basic.yaml.cs" />
138138
<Compile Include="indices.create\10_basic.yaml.cs" />
139139
<Compile Include="indices.delete_alias\10_basic.yaml.cs" />
140-
<Compile Include="indices.delete_alias\all_path_options.yaml.cs" />
141140
<Compile Include="indices.delete_mapping\10_basic.yaml.cs" />
142141
<Compile Include="indices.delete_mapping\all_path_options.yaml.cs" />
143142
<Compile Include="indices.delete_warmer\all_path_options.yaml.cs" />
@@ -165,7 +164,6 @@
165164
<Compile Include="indices.open\20_multiple_indices.yaml.cs" />
166165
<Compile Include="indices.optimize\10_basic.yaml.cs" />
167166
<Compile Include="indices.put_alias\10_basic.yaml.cs" />
168-
<Compile Include="indices.put_alias\all_path_options.yaml.cs" />
169167
<Compile Include="indices.put_mapping\10_basic.yaml.cs" />
170168
<Compile Include="indices.put_mapping\all_path_options.yaml.cs" />
171169
<Compile Include="indices.put_settings\10_basic.yaml.cs" />
@@ -397,4 +395,4 @@
397395
<Paket>True</Paket>
398396
</Reference>
399397
</ItemGroup>
400-
</Project>
398+
</Project>

0 commit comments

Comments
 (0)