Skip to content

Commit a963df2

Browse files
committed
Merge pull request #908 from Tasteful/fix/indexstat
Dont sent TypeNameMarker as type, convert to type-strings
2 parents cace52e + 381afe9 commit a963df2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: src/Nest/DSL/IndicesStatsDescriptor.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public partial class IndicesStatsDescriptor : IndicesOptionalPathDescriptor<Indi
5151
IEnumerable<IndicesStatsMetric> IIndicesStatsRequest.Metrics { get; set; }
5252

5353
//<summary>A comma-separated list of fields for `completion` metric (supports wildcards)</summary>
54-
public IndicesStatsDescriptor Types(params TypeNameMarker[] completion_fields)
54+
public IndicesStatsDescriptor Types(params TypeNameMarker[] types)
5555
{
56-
Self.RequestParameters.AddQueryString("types", completion_fields);
56+
Self.Types = types;
5757
return this;
5858
}
5959

Diff for: src/Tests/Nest.Tests.Unit/BigBadUrlUnitTests.cs

+3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ public void TestAllTheUrls()
113113
Do("POST", "/_bulk", c => c.IndexMany(Enumerable.Range(0, 10).Select(i => new Doc { Id = i.ToString() })));
114114
Do("POST", "/customindex/customtype/_bulk", c => c.IndexMany(Enumerable.Range(0, 10).Select(i => new Doc { Id = i.ToString() }), index: "customindex", type: "customtype"));
115115
Do("GET", "/_stats", c => c.IndicesStats());
116+
Do("GET", "/my_index/_stats", c => c.IndicesStats(s => s.Index("my_index")));
117+
Do("GET", "/my_index/_stats?types=type1", c => c.IndicesStats(s => s.Index("my_index").Types(new TypeNameMarker[] { "type1" })));
118+
Do("GET", "/my_index/_stats?types=type1%2Ctype2", c => c.IndicesStats(s => s.Index("my_index").Types(new TypeNameMarker[] { "type1", "type2" })));
116119
Do("GET", "/mydefaultindex/_stats", c => c.IndicesStats(s => s.Index<Doc>()));
117120
Do("PUT", "/mydefaultindex/doc/_mapping", c => c.Map<Doc>(m => m.MapFromAttributes()));
118121
Do("PUT", "/mycustomindex/doc/_mapping", c => c.Map<Doc>(m => m.Index("mycustomindex")));

0 commit comments

Comments
 (0)