Skip to content

Commit ca3578e

Browse files
committed
started on nested aggregation
1 parent a505866 commit ca3578e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System.Linq;
2+
using Elasticsearch.Net;
3+
using FluentAssertions;
4+
using Nest.Tests.MockData.Domain;
5+
using NUnit.Framework;
6+
7+
namespace Nest.Tests.Integration.Aggregations
8+
{
9+
[TestFixture]
10+
public class NestedBucketAggregationTests : IntegrationTests
11+
{
12+
[Test]
13+
public void Terms()
14+
{
15+
var results = this._client.Search<ElasticsearchProject>(s=>s
16+
.Size(0)
17+
.Aggregations(a=>a
18+
.Nested("followers", n=>n
19+
.Aggregations(t=>t
20+
.Terms("bucket_agg", m=>m.Field(p=>p.Country))
21+
)
22+
)
23+
)
24+
);
25+
results.IsValid.Should().BeTrue();
26+
var bucket = results.Aggs.Terms("bucket_agg");
27+
bucket.Items.Should().NotBeEmpty();
28+
}
29+
30+
}
31+
}

0 commit comments

Comments
 (0)