Optimise the ES query by combining a number of term filters into terms filters