':param new_index: New index to add, can be Index object, index valid string or path to file with index code
:type new_index: string
:param create: Create the index after add or not
:type create: bool
:returns: new index name'

def add_index(self, new_index, create=True, ind_kwargs=None):

    if (ind_kwargs is None):
        ind_kwargs = {}
    p = os.path.join(self.path, '_indexes')
    if (not os.path.exists(p)):
        self.initialize()
    current = sorted(filter((lambda x: x.endswith('.py')), os.listdir(p)))
    if current:
        last = int(current[(-1)][:2])
        _next = (last + 1)
    else:
        _next = 0
    (ind_obj, name) = self.__write_index(new_index, _next, edit=False)
    self.indexes.append(ind_obj)
    self.indexes_names[name] = ind_obj
    if create:
        if self.exists():
            ind_obj.create_index()
    if (name == 'id'):
        self.__set_main_storage()
        self.__compat_things()
    for patch in getattr(ind_obj, 'patchers', ()):
        patch(self, ind_obj)
    return name
