Skip to content

Commit b2dd6b7

Browse files
committedDec 30, 2014
Add missing execution hint options to terms aggregation
Closes #1180
1 parent 6b8453e commit b2dd6b7

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed
 

‎src/Nest/Enums/TermsAggregationExecutionHint.cs

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Runtime.Serialization;
22
using Newtonsoft.Json;
33
using Newtonsoft.Json.Converters;
4+
using System;
45

56
namespace Nest
67
{
@@ -18,7 +19,23 @@ public enum TermsAggregationExecutionHint
1819
/// <summary>
1920
/// Order by using ordinals of the field values instead of the values themselves
2021
/// </summary>
22+
[Obsolete("ordinals was removed from ES in version 1.3. Use global_ordinals instead.")]
2123
[EnumMember(Value = "ordinals")]
22-
Ordinals
24+
Ordinals,
25+
/// <summary>
26+
/// Order by using ordinals of the field and preemptively allocating one bucket per ordinal value
27+
/// </summary>
28+
[EnumMember(Value = "global_ordinals")]
29+
GlobalOrdinals,
30+
/// <summary>
31+
/// Order by using ordinals of the field and dynamically allocating one bucket per ordinal value
32+
/// </summary>
33+
[EnumMember(Value = "global_ordinals_hash")]
34+
GlobalOrdinalsHash,
35+
/// <summary>
36+
/// Order by using per-segment ordinals to compute counts and remap these counts to global counts using global ordinals
37+
/// </summary>
38+
[EnumMember(Value = "global_ordinals_low_cardinality")]
39+
GlobalOrdinalsLowCardinality
2340
}
2441
}

‎src/Tests/Nest.Tests.Unit/ObjectInitializer/Search/SearchBody.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"terms": {
7171
"field": "name",
7272
"size": 10,
73-
"execution_hint": "ordinals"
73+
"execution_hint": "global_ordinals"
7474
},
7575
"aggs": {
7676
"max_count": {

‎src/Tests/Nest.Tests.Unit/ObjectInitializer/Search/SearchRequestTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public SearchRequestTests()
121121
{
122122
Field = Property.Path<ElasticsearchProject>(p=>p.Name),
123123
Size = 10,
124-
ExecutionHint = TermsAggregationExecutionHint.Ordinals,
124+
ExecutionHint = TermsAggregationExecutionHint.GlobalOrdinals,
125125
},
126126
Aggregations = new Dictionary<string, IAggregationContainer>
127127
{

0 commit comments

Comments
 (0)
Please sign in to comment.