Skip to content

Commit d03b722

Browse files
committed
added unit tests for the various terms aggregation options
1 parent d746480 commit d03b722

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"field": "country",
3+
"min_doc_count": 1,
4+
"execution_hint": "global_ordinals_low_cardinality",
5+
"order": {
6+
"_count": "asc"
7+
},
8+
"collect_mode": "breadth_first"
9+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.Reflection;
2+
using Nest.Tests.MockData.Domain;
3+
using NUnit.Framework;
4+
5+
namespace Nest.Tests.Unit.Search.Aggregations.Terms
6+
{
7+
[TestFixture]
8+
public class TermAggregationTests : BaseJsonTests
9+
{
10+
[Test]
11+
public void TermAggregationSerializes()
12+
{
13+
var s = new TermsAggregationDescriptor<ElasticsearchProject>()
14+
.CollectMode(TermsAggregationCollectMode.BreadthFirst)
15+
.ExecutionHint(TermsAggregationExecutionHint.GlobalOrdinalsLowCardinality)
16+
.Field(p => p.Country)
17+
.MinimumDocumentCount(1)
18+
.OrderAscending("_count");
19+
20+
this.JsonEquals(s, MethodBase.GetCurrentMethod());
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)