File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
Tests/Aggregations/Bucket/Terms Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,19 @@ public DocCountBucket<SignificantTermItem> SignificantTerms(string key)
100100 } ;
101101 }
102102
103- public Bucket < KeyedBucketItem > Terms ( string key ) => GetBucket < KeyedBucketItem > ( key ) ;
103+ public TermsBucket Terms ( string key )
104+ {
105+ var bucket = this . TryGet < BucketDto > ( key ) ;
106+ return bucket == null
107+ ? null
108+ : new TermsBucket
109+ {
110+ DocCountErrorUpperBound = bucket . DocCountErrorUpperBound ,
111+ SumOtherDocCount = bucket . SumOtherDocCount ,
112+ Items = bucket . Items . OfType < KeyedBucketItem > ( ) . ToList ( ) ,
113+ Meta = bucket . Meta
114+ } ;
115+ }
104116
105117 public Bucket < HistogramItem > Histogram ( string key )
106118 {
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Threading . Tasks ;
5+
6+ namespace Nest
7+ {
8+ public class TermsBucket : Bucket < KeyedBucketItem >
9+ {
10+ public long ? DocCountErrorUpperBound { get ; set ; }
11+ public long ? SumOtherDocCount { get ; set ; }
12+ }
13+ }
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ protected override void ExpectResponse(ISearchResponse<Project> response)
9494 response . IsValid . Should ( ) . BeTrue ( ) ;
9595 var states = response . Aggs . Terms ( "states" ) ;
9696 states . Should ( ) . NotBeNull ( ) ;
97+ states . DocCountErrorUpperBound . Should ( ) . HaveValue ( ) ;
98+ states . SumOtherDocCount . Should ( ) . HaveValue ( ) ;
9799 foreach ( var item in states . Items )
98100 {
99101 item . Key . Should ( ) . NotBeNullOrEmpty ( ) ;
You can’t perform that action at this time.
0 commit comments