Change aggregates based on filtered query

I guess I can do a bool compound query and say must term1 query1, term2 query2.