def create_search_group(recordset = None, field = None, values = None,
                        criteria_operator = "EqualTo"):
    """
    Create a Coalesce search group/filter object (the value of "group" in a
    `Coalesce search request object
    <https://github.com/InCadence/coalesce/wiki/REST-API#search-query-data-format>`_)
    that combines all entered values for a given field, either including or
    excluding (depending on the value of "criteria_operator") all records
    matching any of the supplied values.

    :param recordset:  the (:class:`str`) recordset of the field to be
        search on
    :param field:  the (:class:`str`) field to be searched on
    :param values:  a :class:`list` or list-like of values to search for.
        The values themselves should be of simple, JSON-serializable types
        (e.g., strings, numbers, Boolean).
    :param criteria_operator:  "EqualTo", if the search is to *include*
        a record matching *any* element of "values", or "NotEqualTo", if
        the search is to *exclude all* records matching *any* element of
        "values".

    :returns:  a Coalesce search group as a :class:`dict`, or ``None`` if
        "values" is empty

    """

    # Check for valid input for "recordset" and "field".
    if not isinstance(recordset, str):
        raise TypeError("Please supply a recordset as a string.")
    if not isinstance(field, str):
        raise TypeError("Please supply a field to search on, as a string.")

    # Check for valid input for "values". This includes a check to make sure
    # we got an iterable of values, not just a single one.
    values_error_msg = "Please supply a list or list-like of values to " + \
                       "search for."
    if not values:
        raise TypeError(values_error_msg)
    elif isinstance(values, str):
        raise TypeError(values_error_msg)
    else:
        try:
            values[0]
        except:
            raise TypeError(values_error_msg)

    # Check for valid inpurt for "criteria_operator".
    if criteria_operator == "EqualTo":
        group_operator = "OR"
    elif criteria_operator == "NotEqualTo":
        group_operator = "AND"
    else:
        raise ValueError('The value of "criteria_operator" must be either ' +
                         '"EqualTo" or "NotEqualTo".')

    # Create the criteria list.
    criteria = []
    for value in values:
        criteria_set = {"recordset": recordset, "field": field,
                        "operator": criteria_operator, "value": value,
                        "matchCase": False}
        criteria.append(criteria_set)

    # Create the search group and return it, or return None if no values
    # were supplied.

    if len(criteria) > 0:
        group = {"operator": group_operator, "criteria": criteria}

    else:
        group = None

    return group