diff --git a/src/Nest/DSL/IndicesStatsDescriptor.cs b/src/Nest/DSL/IndicesStatsDescriptor.cs index 607660b84b6..08b4aaa811c 100644 --- a/src/Nest/DSL/IndicesStatsDescriptor.cs +++ b/src/Nest/DSL/IndicesStatsDescriptor.cs @@ -51,9 +51,9 @@ public partial class IndicesStatsDescriptor : IndicesOptionalPathDescriptor IIndicesStatsRequest.Metrics { get; set; } //A comma-separated list of fields for `completion` metric (supports wildcards) - public IndicesStatsDescriptor Types(params TypeNameMarker[] completion_fields) + public IndicesStatsDescriptor Types(params TypeNameMarker[] types) { - Self.RequestParameters.AddQueryString("types", completion_fields); + Self.Types = types; return this; } diff --git a/src/Tests/Nest.Tests.Unit/BigBadUrlUnitTests.cs b/src/Tests/Nest.Tests.Unit/BigBadUrlUnitTests.cs index 1928d5548cb..eb4f23ddb3c 100644 --- a/src/Tests/Nest.Tests.Unit/BigBadUrlUnitTests.cs +++ b/src/Tests/Nest.Tests.Unit/BigBadUrlUnitTests.cs @@ -113,6 +113,9 @@ public void TestAllTheUrls() Do("POST", "/_bulk", c => c.IndexMany(Enumerable.Range(0, 10).Select(i => new Doc { Id = i.ToString() }))); Do("POST", "/customindex/customtype/_bulk", c => c.IndexMany(Enumerable.Range(0, 10).Select(i => new Doc { Id = i.ToString() }), index: "customindex", type: "customtype")); Do("GET", "/_stats", c => c.IndicesStats()); + Do("GET", "/my_index/_stats", c => c.IndicesStats(s => s.Index("my_index"))); + Do("GET", "/my_index/_stats?types=type1", c => c.IndicesStats(s => s.Index("my_index").Types(new TypeNameMarker[] { "type1" }))); + Do("GET", "/my_index/_stats?types=type1%2Ctype2", c => c.IndicesStats(s => s.Index("my_index").Types(new TypeNameMarker[] { "type1", "type2" }))); Do("GET", "/mydefaultindex/_stats", c => c.IndicesStats(s => s.Index())); Do("PUT", "/mydefaultindex/doc/_mapping", c => c.Map(m => m.MapFromAttributes())); Do("PUT", "/mycustomindex/doc/_mapping", c => c.Map(m => m.Index("mycustomindex")));