Skip to content

Commit 9822b5b

Browse files
committed
Dont sent TypeNameMarker as type, convert to type-strings
1 parent a73b2ff commit 9822b5b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Nest/DSL/IndicesStatsDescriptor.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public partial class IndicesStatsDescriptor : IndicesOptionalPathDescriptor<Indi
5353
//<summary>A comma-separated list of fields for `completion` metric (supports wildcards)</summary>
5454
public IndicesStatsDescriptor Types(params TypeNameMarker[] completion_fields)
5555
{
56-
Self.RequestParameters.AddQueryString("types", completion_fields);
56+
((IIndicesStatsRequest)this).Types = completion_fields;
5757
return this;
5858
}
5959

@@ -65,6 +65,13 @@ public IndicesStatsDescriptor Metrics(params IndicesStatsMetric[] metrics)
6565

6666
protected override void UpdatePathInfo(IConnectionSettingsValues settings, ElasticsearchPathInfo<IndicesStatsRequestParameters> pathInfo)
6767
{
68+
var types = ((IIndicesStatsRequest)this).Types;
69+
var typeNameMarkers = types as TypeNameMarker[] ?? types.ToArray();
70+
if (typeNameMarkers.HasAny())
71+
{
72+
var inferrer = new ElasticInferrer(settings);
73+
pathInfo.RequestParameters.AddQueryString("types", inferrer.TypeNames(typeNameMarkers));
74+
}
6875
IndicesStatsPathInfo.Update(settings, pathInfo, this);
6976
}
7077
}

0 commit comments

Comments
 (0)