Returns the es mapping for the class

        args:
        -----
            base_class: The root class being indexed
            role: the role states how the class should be mapped depending
                  upon whether it is used as a subject of an object. options
                  are es_Nested or rdf_class

def es_indexers(cls, base_class=None, role='rdf_class', **kwargs):
        """ Returns the es mapping for the class

        args:
        -----
            base_class: The root class being indexed
            role: the role states how the class should be mapped depending
                  upon whether it is used as a subject of an object. options
                  are es_Nested or rdf_class
        """

        def _prop_filter(prop, value, **kwargs):
            """ filters out props that should not be used for es_mappings:
            These include props that of the owl:inverseOf the parent_props.
            Use of these props will cause a recursion depth error

            Args:
                prop: the name of the prop
                value: the prop value(an instance of the prop's class)

            Returns:
                bool: whether the prop should be used
            """

            try:
                use_prop = len(set(value.owl_inverseOf) - parent_props) > 0
            except AttributeError:
                use_prop = True
            if prop in nested_props and use_prop:
                return True
            return False
        if not base_class:
            base_class = cls
        rtn_list = []
        # pdb.set_trace()
        if kwargs.get("depth"): # and kwargs.get('class') == cls.__name__:
            kwargs['depth'] += 1
            initial = False
        else:
            initial = True
            kwargs['depth'] = 1
            kwargs['class'] = cls.__name__
            kwargs['class_obj'] = cls
        if kwargs.get('class_obj'):
            parent_props = set(cls.properties)
        else:
            parent_props = set()
        if role == 'rdf_class':
            for value in cls.properties.values():
                # pdb.set_trace()
                rtn_list += value.es_indexers(base_class, **kwargs)

        elif role == 'es_Nested':
            if cls == base_class:
                nested_props = LABEL_FIELDS
            else:
                nested_props = cls.es_defs.get('kds_esNestedProps',
                                               list(cls.properties.keys()))
            used_props = [value
                          for prop, value in cls.properties.items() \
                          if _prop_filter(prop, value, **kwargs)]
            for value in cls.properties.values():
                # pdb.set_trace()
                rtn_list += value.es_indexers(base_class, **kwargs)

        if cls.es_defs.get('kds_esIndex',[None])[0]:
            rtn_list += [cls]
        return list(set(rtn_list))