def remove_query_field(input_query, target_field):
    """Remove the target query field from the search query"""
    # split the query
    split_query = input_query.split(',')
    # allocate memory for the result
    output_query = []
    # for all the parts
    for parts in split_query:
        # split in field and query
        field = parts.split(':')[0]
        # if it's the target field, skip it
        if field == target_field:
            continue
        # otherwise put it in the output query
        output_query.append(parts)
    # assemble the new query minus the target field
    output_query = ','.join(output_query)
    return output_query