Add support for terms and wildcard queries