Skip to content

Commit 1d0a604

Browse files
committed
Merge branch '2.x' into feature/2.x-reindex-rethrottle
# Conflicts: # src/Elasticsearch.Net/Domain/Enums.Generated.cs # src/Nest/_Generated/_Descriptors.generated.cs # src/Nest/_Generated/_Requests.generated.cs
2 parents 71c70ca + ac089d6 commit 1d0a604

File tree

13 files changed

+304
-782
lines changed

13 files changed

+304
-782
lines changed

src/CodeGeneration/ApiGenerator/Domain/CsharpMethod.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,17 @@ public IEnumerable<Constructor> DescriptorConstructors()
191191
{
192192
doc += "\r\n" + string.Join("\t\t\r\n", cp.Select(p => $"///<param name=\"{p.Key}\"> this parameter is required</param>"));
193193
}
194-
var c = new Constructor { Generated = $"public {m}({par}) : base({routing}){{}}", Description = doc };
194+
195+
var generated = $"public {m}({par}) : base({routing}){{}}";
196+
197+
// Add typeof(T) as the default type when only index specified
198+
if ((m == "UpdateByQueryDescriptor") && cp.Count() == 1 && !string.IsNullOrEmpty(this.RequestTypeGeneric))
199+
{
200+
var generic = this.RequestTypeGeneric.Replace("<", "").Replace(">", "");
201+
generated = $"public {m}({par}) : base({routing}.Required(\"type\", (Types)typeof({generic}))){{}}";
202+
}
203+
204+
var c = new Constructor { Generated = generated, Description = doc };
195205
ctors.Add(c);
196206
}
197207
if (IsDocumentPath && !string.IsNullOrEmpty(this.DescriptorTypeGeneric))

src/CodeGeneration/ApiGenerator/RestSpecification/Core/root.html

Lines changed: 147 additions & 604 deletions
Large diffs are not rendered by default.

src/CodeGeneration/ApiGenerator/RestSpecification/DeleteByQuery/root.html

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010

1111
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/frameworks-b54806b006ba52935377cfa698af8bb2200dd03318001e967d986314f4c11d29.css" media="all" rel="stylesheet" />
12-
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-7779b57edafe155a3aa1b637cecde8ee61b92710fda0c54fdffc9826639a0bdd.css" media="all" rel="stylesheet" />
12+
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-8b2474817eaa20276db40d0e1b2273134aab8755285e953f318eae52da59a971.css" media="all" rel="stylesheet" />
1313

1414

1515
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/site-f6ce114ac3bc145f575863b4a6dbdf65e924bccb184fc4d4a4f5a09819b4173d.css" media="all" rel="stylesheet" />
1616

1717

18-
<link as="script" href="https://assets-cdn.github.com/assets/frameworks-779e3c6faa0d0139afab0793984d0529dd910e1645b109e2e6a281ae6a97ad7a.js" rel="preload" />
18+
<link as="script" href="https://assets-cdn.github.com/assets/frameworks-2c76cc192ef357ffd1604a67307c1426cfd7513a720b1a87d1f53eb24a928308.js" rel="preload" />
1919

20-
<link as="script" href="https://assets-cdn.github.com/assets/github-610f0ec6bfdb0c7e0930c7f65c6a5216107e3d66611e9bca8d69f06dde94283b.js" rel="preload" />
20+
<link as="script" href="https://assets-cdn.github.com/assets/github-5124bc733834808e4d93c497e1e824659031c173802edc0ebeaa873f26290e00.js" rel="preload" />
2121

2222
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2323
<meta http-equiv="Content-Language" content="en">
@@ -46,7 +46,7 @@
4646

4747
<meta name="pjax-timeout" content="1000">
4848

49-
<meta name="request-id" content="3CF105D8:248E:80B3EF6:57E345BF" data-pjax-transient>
49+
<meta name="request-id" content="3CF105D8:248E:94DEBA8:57E48228" data-pjax-transient>
5050

5151
<meta name="msapplication-TileImage" content="/windows-tile.png">
5252
<meta name="msapplication-TileColor" content="#ffffff">
@@ -56,7 +56,7 @@
5656
<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA">
5757
<meta name="google-analytics" content="UA-3769691-2">
5858

59-
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="3CF105D8:248E:80B3EF6:57E345BF" name="octolytics-dimension-request_id" />
59+
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="3CF105D8:248E:94DEBA8:57E48228" name="octolytics-dimension-request_id" />
6060
<meta content="/&lt;user-name&gt;/&lt;repo-name&gt;/files/disambiguate" data-pjax-transient="true" name="analytics-location" />
6161

6262

@@ -69,16 +69,16 @@
6969
<meta name="user-login" content="">
7070

7171
<meta name="expected-hostname" content="github.com">
72-
<meta name="js-proxy-site-detection-payload" content="YmYwZTI4OTFjOTVkMDI0ZDQwNGI0OTJiODBjNzcyYzg5ZjMzYmI4Y2E3NmM4Nzg0YzI4YWYzNjJjNzI2MDJkMnx7InJlbW90ZV9hZGRyZXNzIjoiNjAuMjQxLjUuMjE2IiwicmVxdWVzdF9pZCI6IjNDRjEwNUQ4OjI0OEU6ODBCM0VGNjo1N0UzNDVCRiIsInRpbWVzdGFtcCI6MTQ3NDUxMjMyMH0=">
72+
<meta name="js-proxy-site-detection-payload" content="OGU3OTY0YjI4ZmY2M2Q4MjlkZGNjODdiMDgzYWQ3ZDQwZGMyMjY1NDkwOTdiZjViMjJlODFiMzgzNGM4NTM3OHx7InJlbW90ZV9hZGRyZXNzIjoiNjAuMjQxLjUuMjE2IiwicmVxdWVzdF9pZCI6IjNDRjEwNUQ4OjI0OEU6OTRERUJBODo1N0U0ODIyOCIsInRpbWVzdGFtcCI6MTQ3NDU5MzMyMH0=">
7373

7474

7575
<link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#4078c0">
7676
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
7777

78-
<meta name="html-safe-nonce" content="d64929332fb9fdf01f471c869248d025df93e6ac">
79-
<meta content="c4a1c1984d0b3a502bb18d4a6fdd4666eedeba4d" name="form-nonce" />
78+
<meta name="html-safe-nonce" content="8f2234e4d7a52c9094fb896655cbde482970c5a8">
79+
<meta content="4976261c6b5696b032bf1f84c0266a7b4d8795e3" name="form-nonce" />
8080

81-
<meta http-equiv="x-pjax-version" content="799233884d6b105cb0d71874f12b85fe">
81+
<meta http-equiv="x-pjax-version" content="887caaf9b12cc4c32735762b46c900fe">
8282

8383

8484

@@ -183,8 +183,8 @@
183183
Watch
184184
</a>
185185
<a class="social-count" href="/elastic/elasticsearch/watchers"
186-
aria-label="1743 users are watching this repository">
187-
1,743
186+
aria-label="1747 users are watching this repository">
187+
1,747
188188
</a>
189189

190190
</li>
@@ -198,8 +198,8 @@
198198
</a>
199199

200200
<a class="social-count js-social-count" href="/elastic/elasticsearch/stargazers"
201-
aria-label="18489 users starred this repository">
202-
18,489
201+
aria-label="18504 users starred this repository">
202+
18,504
203203
</a>
204204

205205
</li>
@@ -213,8 +213,8 @@
213213
</a>
214214

215215
<a href="/elastic/elasticsearch/network" class="social-count"
216-
aria-label="6291 users are forked this repository">
217-
6,291
216+
aria-label="6297 users are forked this repository">
217+
6,297
218218
</a>
219219
</li>
220220
</ul>
@@ -247,15 +247,15 @@ <h1 class="public ">
247247
<a href="/elastic/elasticsearch/issues" class="js-selected-navigation-item reponav-item" data-hotkey="g i" data-selected-links="repo_issues repo_labels repo_milestones /elastic/elasticsearch/issues" itemprop="url">
248248
<svg aria-hidden="true" class="octicon octicon-issue-opened" height="16" version="1.1" viewBox="0 0 14 16" width="14"><path d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
249249
<span itemprop="name">Issues</span>
250-
<span class="counter">1,039</span>
250+
<span class="counter">1,041</span>
251251
<meta itemprop="position" content="2">
252252
</a> </span>
253253

254254
<span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement">
255255
<a href="/elastic/elasticsearch/pulls" class="js-selected-navigation-item reponav-item" data-hotkey="g p" data-selected-links="repo_pulls /elastic/elasticsearch/pulls" itemprop="url">
256256
<svg aria-hidden="true" class="octicon octicon-git-pull-request" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"></path></svg>
257257
<span itemprop="name">Pull requests</span>
258-
<span class="counter">79</span>
258+
<span class="counter">80</span>
259259
<meta itemprop="position" content="3">
260260
</a> </span>
261261

@@ -815,6 +815,16 @@ <h1 class="public ">
815815
russcam-patch-2
816816
</span>
817817
</a>
818+
<a class="select-menu-item js-navigation-item js-navigation-open "
819+
href="/elastic/elasticsearch/tree/russcam-patch-2.4.0-reindex-rethrottle/plugins/delete-by-query/src/test/resources/rest-api-spec/api"
820+
data-name="russcam-patch-2.4.0-reindex-rethrottle"
821+
data-skip-pjax="true"
822+
rel="nofollow">
823+
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5z"></path></svg>
824+
<span class="select-menu-item-text css-truncate-target js-select-menu-filter-text">
825+
russcam-patch-2.4.0-reindex-rethrottle
826+
</span>
827+
</a>
818828
<a class="select-menu-item js-navigation-item js-navigation-open "
819829
href="/elastic/elasticsearch/tree/russcam-patch-3/plugins/delete-by-query/src/test/resources/rest-api-spec/api"
820830
data-name="russcam-patch-3"
@@ -1984,7 +1994,7 @@ <h1 class="public ">
19841994
<svg aria-hidden="true" class="octicon octicon-mark-github" height="24" version="1.1" viewBox="0 0 16 16" width="24"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg>
19851995
</a>
19861996
<ul class="site-footer-links">
1987-
<li>&copy; 2016 <span title="0.05026s from github-fe134-cp1-prd.iad.github.net">GitHub</span>, Inc.</li>
1997+
<li>&copy; 2016 <span title="0.07898s from github-fe-bc3c088.cp1-iad.github.net">GitHub</span>, Inc.</li>
19881998
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
19891999
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
19902000
<li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
@@ -2008,8 +2018,8 @@ <h1 class="public ">
20082018

20092019

20102020
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/compat-40e365359d1c4db1e36a55be458e60f2b7c24d58b5a00ae13398480e7ba768e0.js"></script>
2011-
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-779e3c6faa0d0139afab0793984d0529dd910e1645b109e2e6a281ae6a97ad7a.js"></script>
2012-
<script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github-610f0ec6bfdb0c7e0930c7f65c6a5216107e3d66611e9bca8d69f06dde94283b.js"></script>
2021+
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-2c76cc192ef357ffd1604a67307c1426cfd7513a720b1a87d1f53eb24a928308.js"></script>
2022+
<script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github-5124bc733834808e4d93c497e1e824659031c173802edc0ebeaa873f26290e00.js"></script>
20132023

20142024

20152025

src/Nest/Document/Multiple/UpdateByQuery/ElasticClient-UpdateByQuery.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,30 @@ namespace Nest
77
public partial interface IElasticClient
88
{
99
/// <summary>
10-
/// The delete by query API allows to delete documents from one or more indices and one or more types based on a query.
11-
/// <para> </para><a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete-by-query.html</a>
10+
/// The update by query API allows to update documents from one or more indices and one or more types based on a query.
11+
/// <para> </para><a href="https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-update-by-query.html">https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-update-by-query.html</a>
1212
/// </summary>
1313
/// <typeparam name="T">The type used to infer the default index and typename as well as describe the strongly
1414
/// typed parts of the query</typeparam>
15-
/// <param name="selector">An optional descriptor to further describe the delete by query operation</param>
15+
/// <param name="selector">An optional descriptor to further describe the update by query operation</param>
1616
IUpdateByQueryResponse UpdateByQuery<T>(Indices indices, Types types, Func<UpdateByQueryDescriptor<T>, IUpdateByQueryRequest> selector)
1717
where T : class;
1818

19+
/// <inheritdoc/>
20+
IUpdateByQueryResponse UpdateByQuery<T>(Func<UpdateByQueryDescriptor<T>, IUpdateByQueryRequest> selector)
21+
where T : class;
22+
1923
/// <inheritdoc/>
2024
IUpdateByQueryResponse UpdateByQuery(IUpdateByQueryRequest request);
2125

2226
/// <inheritdoc/>
2327
Task<IUpdateByQueryResponse> UpdateByQueryAsync<T>(Indices indices, Types types, Func<UpdateByQueryDescriptor<T>, IUpdateByQueryRequest> selector)
2428
where T : class;
2529

30+
/// <inheritdoc/>
31+
Task<IUpdateByQueryResponse> UpdateByQueryAsync<T>(Func<UpdateByQueryDescriptor<T>, IUpdateByQueryRequest> selector)
32+
where T : class;
33+
2634
/// <inheritdoc/>
2735
Task<IUpdateByQueryResponse> UpdateByQueryAsync(IUpdateByQueryRequest request);
2836

@@ -34,6 +42,10 @@ public partial class ElasticClient
3442
public IUpdateByQueryResponse UpdateByQuery<T>(Indices indices, Types types, Func<UpdateByQueryDescriptor<T>, IUpdateByQueryRequest> selector) where T : class =>
3543
this.UpdateByQuery(selector?.Invoke(new UpdateByQueryDescriptor<T>(indices).Type(types)));
3644

45+
/// <inheritdoc/>
46+
public IUpdateByQueryResponse UpdateByQuery<T>(Func<UpdateByQueryDescriptor<T>, IUpdateByQueryRequest> selector) where T : class =>
47+
this.UpdateByQuery(selector?.Invoke(new UpdateByQueryDescriptor<T>(typeof(T))));
48+
3749
/// <inheritdoc/>
3850
public IUpdateByQueryResponse UpdateByQuery(IUpdateByQueryRequest request) =>
3951
this.Dispatcher.Dispatch<IUpdateByQueryRequest, UpdateByQueryRequestParameters, UpdateByQueryResponse>(
@@ -45,6 +57,10 @@ public IUpdateByQueryResponse UpdateByQuery(IUpdateByQueryRequest request) =>
4557
public Task<IUpdateByQueryResponse> UpdateByQueryAsync<T>(Indices indices, Types types, Func<UpdateByQueryDescriptor<T>, IUpdateByQueryRequest> selector) where T : class =>
4658
this.UpdateByQueryAsync(selector?.Invoke(new UpdateByQueryDescriptor<T>(indices).Type(types)));
4759

60+
/// <inheritdoc/>
61+
public Task<IUpdateByQueryResponse> UpdateByQueryAsync<T>(Func<UpdateByQueryDescriptor<T>, IUpdateByQueryRequest> selector) where T : class =>
62+
this.UpdateByQueryAsync(selector?.Invoke(new UpdateByQueryDescriptor<T>(typeof(T))));
63+
4864
/// <inheritdoc/>
4965
public Task<IUpdateByQueryResponse> UpdateByQueryAsync(IUpdateByQueryRequest request) =>
5066
this.Dispatcher.DispatchAsync<IUpdateByQueryRequest, UpdateByQueryRequestParameters, UpdateByQueryResponse, IUpdateByQueryResponse>(

src/Nest/Indices/AliasManagement/GetAlias/ElasticClient-GetAlias.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public IGetAliasesResponse GetAlias(Func<GetAliasDescriptor, IGetAliasRequest> s
3636
public IGetAliasesResponse GetAlias(IGetAliasRequest request) =>
3737
this.Dispatcher.Dispatch<IGetAliasRequest, GetAliasRequestParameters, GetAliasesResponse>(
3838
request,
39-
DeserializeGetAliasesResponse,
4039
(p, d) => this.LowLevelDispatch.IndicesGetAliasDispatch<GetAliasesResponse>(p)
4140
);
4241

@@ -48,7 +47,6 @@ public Task<IGetAliasesResponse> GetAliasAsync(Func<GetAliasDescriptor, IGetAlia
4847
public Task<IGetAliasesResponse> GetAliasAsync(IGetAliasRequest request) =>
4948
this.Dispatcher.DispatchAsync<IGetAliasRequest, GetAliasRequestParameters, GetAliasesResponse, IGetAliasesResponse>(
5049
request,
51-
DeserializeGetAliasesResponse,
5250
(p, d) => this.LowLevelDispatch.IndicesGetAliasDispatchAsync<GetAliasesResponse>(p)
5351
);
5452
}

0 commit comments

Comments
 (0)