Skip to content

Commit 5bb7584

Browse files
committed
support for the new _count format
1 parent c4fefcf commit 5bb7584

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/Nest/DSL/CountDescriptor.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@
55
namespace Nest
66
{
77
[DescriptorFor("Count")]
8-
[JsonConverter(typeof(CustomJsonConverter))]
98
public partial class CountDescriptor<T>
109
: QueryPathDescriptorBase<CountDescriptor<T>, T, CountQueryString>
11-
, IActAsQuery
1210
, IPathInfo<CountQueryString>
13-
, ICustomJson
1411
where T : class
1512
{
16-
BaseQuery IActAsQuery._Query { get; set; }
13+
[JsonProperty("query")]
14+
internal BaseQuery _Query { get; set; }
1715

1816
public CountDescriptor<T> Query(Func<QueryDescriptor<T>, BaseQuery> querySelector)
1917
{
20-
((IActAsQuery)this)._Query = querySelector(new QueryDescriptor<T>());
18+
this._Query = querySelector(new QueryDescriptor<T>());
2119
return this;
2220
}
2321

@@ -31,10 +29,5 @@ ElasticsearchPathInfo<CountQueryString> IPathInfo<CountQueryString>.ToPathInfo(I
3129

3230
return pathInfo;
3331
}
34-
35-
object ICustomJson.GetCustomJson()
36-
{
37-
return ((IActAsQuery) this)._Query;
38-
}
3932
}
4033
}

0 commit comments

Comments
 (0)