Add maximum-average-interval and minimum-average-interval query terms.