Filter terms array with term length