def create_term_query(key, values, query_type):
    """Return an all or any term query for es"""
    if query_type == "or":
        return [{"terms": {key: values}}]
    else:
        return [{"term": {key: value}} for value in values]