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

    """
    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.')
    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)
    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".')
    criteria = []
    for value in values:
        criteria_set = {'recordset': recordset, 'field': field, 'operator':
            criteria_operator, 'value': value, 'matchCase': False}
        criteria.append(criteria_set)
    if len(criteria) > 0:
        group = {'operator': group_operator, 'criteria': criteria}
    else:
        group = None
    return group
