Conditional aggregations.

Description

So in the case of:

.aggregation(aggkey, p -> {

return p.terms().field("search_field", String.class).maxTermCount(10);

})

How does one put in a list of fields. I would like to be able to pass in a list of fields to get aggregations for. Or if lets say List<String> aggregation_fields; is empty not call the .aggregation() at all. Maybe this is just an education issue? Please educate me.

Activity

Show:

Yoann Rodière February 9, 2022 at 7:24 AM

I’d say create one aggregation key and call .aggregation once per field in your list? And none at all if there is no field?

In any case… for usage questions, please use other channels, such as the forums or stackoverflow. This is for bug reports and feature requests only. We can always create Jira tickets once we determine your question actually requires a new feature.

Incomplete

Details

Assignee

Reporter

Priority

Created February 9, 2022 at 4:57 AM
Updated February 9, 2022 at 7:24 AM
Resolved February 9, 2022 at 7:24 AM