Auto add value field if aggregations are requested.
This commit is contained in:
@ -79,6 +79,11 @@ public class QueryValidator implements Validator {
|
||||
if (query.getAggregation().getAggregations() == null || query.getAggregation().getAggregations().isEmpty()) {
|
||||
query.getAggregation().setAggregations(new ArrayList<>(defaultResponseAggregations));
|
||||
}
|
||||
|
||||
if (!query.getFields().contains(QueryField.value)) {
|
||||
// without this field, json will not contain Stats (as
|
||||
query.addField(QueryField.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user