def apply_search_string(term_order, query, comments):
    """
    Applies the cleaned query to the values generated by the comment search

    Args:
        query {str} : the cleaned query search string
        term_order {tuple} : the non-deduped, ordered terms as they appear
        comments {DataFrame} : a Pandas dataFrame with comment data
    Returns:
        A Pandas DataFrame with the updated columns
    """
    def cut(row):
        row_bools = [row[term] for term in term_order]
        return eval(query.format(*row_bools))

    mask = comments.apply(cut, axis=1)
    return comments[mask]