Auto add value field if aggregations are requested.
This commit is contained in:
1 parent
da23be0e4c
commit
a77c5665be
1 file changed
+5
@@ -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