Aggregations: key_as_string only shown when format specified in terms agg
The key_as_string field is now not shown in the terms aggregation for long and double fields unless the format parameter is specified Closes #7125
This commit is contained in:
parent
0da5cecc3c
commit
9c89fcf5a2
|
@ -180,7 +180,7 @@ public class DoubleTerms extends InternalTerms {
|
|||
for (InternalTerms.Bucket bucket : buckets) {
|
||||
builder.startObject();
|
||||
builder.field(CommonFields.KEY, ((Bucket) bucket).term);
|
||||
if (formatter != null) {
|
||||
if (formatter != null && formatter != ValueFormatter.RAW) {
|
||||
builder.field(CommonFields.KEY_AS_STRING, formatter.format(((Bucket) bucket).term));
|
||||
}
|
||||
builder.field(CommonFields.DOC_COUNT, bucket.getDocCount());
|
||||
|
|
|
@ -181,7 +181,7 @@ public class LongTerms extends InternalTerms {
|
|||
for (InternalTerms.Bucket bucket : buckets) {
|
||||
builder.startObject();
|
||||
builder.field(CommonFields.KEY, ((Bucket) bucket).term);
|
||||
if (formatter != null) {
|
||||
if (formatter != null && formatter != ValueFormatter.RAW) {
|
||||
builder.field(CommonFields.KEY_AS_STRING, formatter.format(((Bucket) bucket).term));
|
||||
}
|
||||
builder.field(CommonFields.DOC_COUNT, bucket.getDocCount());
|
||||
|
|
Loading…
Reference in New Issue