'Convert more Python data types to ES-understandable JSON.'

def _from_python(self, value):

    iso = self._iso_datetime(value)
    if iso:
        return iso
    elif isinstance(value, six.binary_type):
        return six.text_type(value, errors=u'replace')
    elif isinstance(value, set):
        return list(value)
    return value
