Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

Commit

Permalink
fix(analytics): set aggregation size to retrieve all terms (e.g HTTP …
Browse files Browse the repository at this point in the history
…Response Status)

fixes gravitee-io/issues#2813
  • Loading branch information
tcompiegne authored and NicolasGeraud committed Nov 1, 2019
1 parent 2797f47 commit fa959b3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Expand Up @@ -24,4 +24,6 @@ public interface Aggregation {
AggregationType type();

String field();

Integer size();
}
Expand Up @@ -35,6 +35,10 @@ public DateHistogramQueryBuilder aggregation(Aggregation aggregation) {
}

public DateHistogramQueryBuilder aggregation(AggregationType type, String field) {
return aggregation(type, field, null);
}

public DateHistogramQueryBuilder aggregation(AggregationType type, String field, Integer size) {
query.aggregations().add(new Aggregation() {
@Override
public AggregationType type() {
Expand All @@ -45,6 +49,11 @@ public AggregationType type() {
public String field() {
return field;
}

@Override
public Integer size() {
return size;
}
});

return this;
Expand Down
Expand Up @@ -38,6 +38,10 @@ public DateHistogramQueryBuilder aggregation(Aggregation aggregation) {
}

public DateHistogramQueryBuilder aggregation(AggregationType type, String field) {
return aggregation(type, field, null);
}

public DateHistogramQueryBuilder aggregation(AggregationType type, String field, Integer size) {
query.aggregations().add(new Aggregation() {
@Override
public AggregationType type() {
Expand All @@ -48,6 +52,11 @@ public AggregationType type() {
public String field() {
return field;
}

@Override
public Integer size() {
return size;
}
});

return this;
Expand Down

0 comments on commit fa959b3

Please sign in to comment.