I have a use case where I need to get buckets (with documents) and depending on the bucket, specify different field to sort by.
All documents have the field, say, "type", which I will aggregate by. And for just 1 type I want the documents returned to be sorted by createdTime. Rest all documents should be sorted by modifiedTime. Can I achieve this within a single aggregation?
I know I can achieve my goal with 2 parallel partial aggregations (separate the one type from the rest).
I assume this could have been not added because this is a rarer case where the querier knows the key of the buckets that are going to be returned. Let me know if this can be done in a single aggregation?
Thanks for the help!