Pipeline Aggregation for Date histrogram with terms in Java, elastic 6.6

Hi,

I am kind of struugling with coming up with a Java equivalent to the solution posted here.

AggregationBuilders.global("global_aggregation")
		.subAggregation(AggregationBuilders.dateHistogram("dateAggr")
        .field("IngestedTime").dateHistogramInterval(DateHistogramInterval.DAY).timeZone(dt)
        .subAggregation(PipelineAggregatorBuilders. // how do I include the terms here?)