-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement indices.reload_search_analyzers #4529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d38df95
Update specifications for 7.7.0
codebrain 510eb97
Generate all beta and experimental APIs in the LLC
codebrain 0a3d8fd
Fix API generator (#4456) (#4514) (#4517)
github-actions[bot] 8ed85df
Regenerate APIs using fixed generator
codebrain 59d38d3
Update API list to categorise implementations for 7.7
codebrain 0b1aca0
Implement indices.reload_search_analyzers
codebrain 74618fa
Merge branch '7.7' into feature/7.7/apis/reload-search-analyzers
codebrain 881db80
Implement Skipversion attribute
codebrain 9f49748
Assert response
codebrain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
using Elasticsearch.Net; | ||
|
||
namespace Nest | ||
{ | ||
public class ReloadDetails | ||
{ | ||
[DataMember(Name ="index")] | ||
public string Index { get; internal set; } | ||
|
||
[DataMember(Name ="reloaded_analyzers")] | ||
public IReadOnlyCollection<string> ReloadedAnalyzers { get; internal set; } = EmptyReadOnly<string>.Collection; | ||
|
||
[DataMember(Name ="reloaded_node_ids")] | ||
public IReadOnlyCollection<string> ReloadedNodeIds { get; internal set; } = EmptyReadOnly<string>.Collection; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Nest/Indices/ReloadSearchAnalyzers/ReloadSearchAnalyzersRequest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Nest | ||
{ | ||
[MapsApi("indices.reload_search_analyzers.json")] | ||
public partial interface IReloadSearchAnalyzersRequest { } | ||
|
||
public partial class ReloadSearchAnalyzersRequest { } | ||
|
||
public partial class ReloadSearchAnalyzersDescriptor { } | ||
} |
15 changes: 15 additions & 0 deletions
15
src/Nest/Indices/ReloadSearchAnalyzers/ReloadSearchAnalyzersResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
using Elasticsearch.Net; | ||
|
||
namespace Nest | ||
{ | ||
public class ReloadSearchAnalyzersResponse : ResponseBase | ||
{ | ||
[DataMember(Name ="_shards")] | ||
public ShardStatistics Shards { get; internal set; } | ||
|
||
[DataMember(Name ="reload_details")] | ||
public IReadOnlyCollection<ReloadDetails> ReloadDetails { get; internal set; } = EmptyReadOnly<ReloadDetails>.Collection; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
tests/Tests/Indices/ReloadSearchAnalyzers/ReloadSearchAnalyzersApiTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using Elastic.Xunit.XunitPlumbing; | ||
using Elasticsearch.Net; | ||
using Nest; | ||
using Tests.Core.Extensions; | ||
using Tests.Core.ManagedElasticsearch.Clusters; | ||
using Tests.Framework.EndpointTests; | ||
using Tests.Framework.EndpointTests.TestState; | ||
|
||
namespace Tests.Indices.ReloadSearchAnalyzers | ||
{ | ||
[SkipVersion("<7.7.0", "Introduced in 7.7.0")] | ||
public class ReloadSearchAnalyzersApiTests | ||
: ApiIntegrationTestBase<ReadOnlyCluster, ReloadSearchAnalyzersResponse, IReloadSearchAnalyzersRequest, ReloadSearchAnalyzersDescriptor, ReloadSearchAnalyzersRequest> | ||
{ | ||
public ReloadSearchAnalyzersApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { } | ||
|
||
protected override bool ExpectIsValid => true; | ||
protected override int ExpectStatusCode => 200; | ||
|
||
protected override ReloadSearchAnalyzersDescriptor NewDescriptor() => new ReloadSearchAnalyzersDescriptor(CallIsolatedValue); | ||
|
||
protected override Func<ReloadSearchAnalyzersDescriptor, IReloadSearchAnalyzersRequest> Fluent => d => d.Index(CallIsolatedValue); | ||
protected override HttpMethod HttpMethod => HttpMethod.POST; | ||
|
||
protected override ReloadSearchAnalyzersRequest Initializer => new ReloadSearchAnalyzersRequest(CallIsolatedValue); | ||
protected override string UrlPath => $"/{CallIsolatedValue}/_reload_search_analyzers"; | ||
|
||
protected override LazyResponses ClientUsage() => Calls( | ||
(client, f) => client.Indices.ReloadSearchAnalyzers(CallIsolatedValue, f), | ||
(client, f) => client.Indices.ReloadSearchAnalyzersAsync(CallIsolatedValue, f), | ||
(client, r) => client.Indices.ReloadSearchAnalyzers(r), | ||
(client, r) => client.Indices.ReloadSearchAnalyzersAsync(r) | ||
); | ||
|
||
protected override void ExpectResponse(ReloadSearchAnalyzersResponse response) => response.ShouldBeValid(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/Tests/Indices/ReloadSearchAnalyzers/ReloadSearchAnalyzersUrlTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Threading.Tasks; | ||
using Elastic.Xunit.XunitPlumbing; | ||
using Nest; | ||
using Tests.Framework.EndpointTests; | ||
using static Tests.Framework.EndpointTests.UrlTester; | ||
using static Nest.Indices; | ||
|
||
namespace Tests.Indices.ReloadSearchAnalyzers | ||
{ | ||
public class ReloadSearchAnalyzersUrlTests | ||
{ | ||
[U] public async Task Urls() | ||
{ | ||
await POST($"/_all/_reload_search_analyzers") | ||
.Fluent(c => c.Indices.ReloadSearchAnalyzers(All)) | ||
.Request(c => c.Indices.ReloadSearchAnalyzers(new ReloadSearchAnalyzersRequest(All))) | ||
.FluentAsync(c => c.Indices.ReloadSearchAnalyzersAsync(All)) | ||
.RequestAsync(c => c.Indices.ReloadSearchAnalyzersAsync(new ReloadSearchAnalyzersRequest(All))) | ||
; | ||
|
||
var index = "index1,index2"; | ||
await POST($"/index1%2Cindex2/_reload_search_analyzers") | ||
.Fluent(c => c.Indices.ReloadSearchAnalyzers(index)) | ||
.Request(c => c.Indices.ReloadSearchAnalyzers(new ReloadSearchAnalyzersRequest(index))) | ||
.FluentAsync(c => c.Indices.ReloadSearchAnalyzersAsync(index)) | ||
.RequestAsync(c => c.Indices.ReloadSearchAnalyzersAsync(new ReloadSearchAnalyzersRequest(index))) | ||
; | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.