Skip to content

Commit 99dbe50

Browse files
committed
fix #1127 missing lang property on metricaggregationbase, also noticed it was missing updatedesciptor
1 parent 004f910 commit 99dbe50

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Nest/DSL/Aggregations/MetricAggregationBaseDescriptor.cs

+14
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ public interface IMetricAggregator
1616

1717
[JsonProperty("params")]
1818
IDictionary<string, object> Params { get; set; }
19+
20+
[JsonProperty(PropertyName = "lang")]
21+
string Language { get; set; }
22+
1923
}
2024

2125
public abstract class MetricAggregator : IMetricAggregator
2226
{
2327
public PropertyPathMarker Field { get; set; }
2428
public string Script { get; set; }
2529
public IDictionary<string, object> Params { get; set; }
30+
public string Language { get; set; }
2631
}
2732

2833
public abstract class MetricAggregationBaseDescriptor<TMetricAggregation, T> : IAggregationDescriptor, IMetricAggregator
@@ -37,6 +42,8 @@ public abstract class MetricAggregationBaseDescriptor<TMetricAggregation, T> : I
3742

3843
IDictionary<string, object> IMetricAggregator.Params { get; set; }
3944

45+
string IMetricAggregator.Language { get; set; }
46+
4047
public TMetricAggregation Field(string field)
4148
{
4249
Self.Field = field;
@@ -60,5 +67,12 @@ public TMetricAggregation Params(Func<FluentDictionary<string, object>, FluentDi
6067
Self.Params = paramSelector(new FluentDictionary<string, object>());
6168
return (TMetricAggregation) this;
6269
}
70+
71+
public TMetricAggregation Language(string language)
72+
{
73+
Self.Language = language;
74+
return (TMetricAggregation)this;
75+
}
76+
6377
}
6478
}

src/Nest/DSL/UpdateDescriptor.cs

+6
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ public UpdateDescriptor<TDocument, TPartialDocument> Params(Func<FluentDictionar
130130
return this;
131131
}
132132

133+
public UpdateDescriptor<TDocument, TPartialDocument> Language(string language)
134+
{
135+
Self.Language = language;
136+
return this;
137+
}
138+
133139
public UpdateDescriptor<TDocument, TPartialDocument> Id(TDocument document, bool useAsUpsert)
134140
{
135141
((IDocumentOptionalPath<UpdateRequestParameters, TDocument>)Self).IdFrom = document;

0 commit comments

Comments
 (0)