Skip to content

Commit 9f395cd

Browse files
author
Jakub Stachowski
committed
Add shard_size support to TermStats facet
1 parent 0cbf70b commit 9f395cd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Nest/DSL/Facets/TermsStatsFacetDescriptor.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public interface ITermsStatsFacetRequest : IFacetRequest
3434
[JsonProperty(PropertyName = "size")]
3535
int? Size { get; set; }
3636

37+
[JsonProperty(PropertyName = "shard_size")]
38+
int? ShardSize { get; set; }
39+
3740
[JsonProperty(PropertyName = "params")]
3841
[JsonConverter(typeof (DictionaryKeysAreNotPropertyNamesJsonConverter))]
3942
Dictionary<string, object> Params { get; set; }
@@ -48,6 +51,7 @@ public class TermsStatsFacetRequest : FacetRequest, ITermsStatsFacetRequest
4851
public TermsStatsOrder? Order { get; set; }
4952
public string Lang { get; set; }
5053
public int? Size { get; set; }
54+
public int? ShardSize { get; set; }
5155
public Dictionary<string, object> Params { get; set; }
5256
}
5357

@@ -69,6 +73,8 @@ public class TermsStatsFacetDescriptor<T> : BaseFacetDescriptor<TermsStatsFacetD
6973

7074
int? ITermsStatsFacetRequest.Size { get; set; }
7175

76+
int? ITermsStatsFacetRequest.ShardSize { get; set; }
77+
7278
Dictionary<string, object> ITermsStatsFacetRequest.Params { get; set; }
7379

7480
public TermsStatsFacetDescriptor<T> KeyField(Expression<Func<T, object>> objectPath)
@@ -113,6 +119,11 @@ public TermsStatsFacetDescriptor<T> Language(string language)
113119
Self.Lang = language;
114120
return this;
115121
}
122+
public TermsStatsFacetDescriptor<T> ShardSize(int shardSize)
123+
{
124+
Self.ShardSize = shardSize;
125+
return this;
126+
}
116127
public TermsStatsFacetDescriptor<T> Size(int size)
117128
{
118129
size.ThrowIfNull("size");

0 commit comments

Comments
 (0)