def METHOD_NAME():
    from ckan.lib.search import commit
    db_url = config['sqlalchemy.url']
    engine = sa.create_engine(db_url)
    package_ids = []
    result = engine.execute(u"select id from package where state = 'active';")
    for row in result:
        package_ids.append(row[0])
    def start(ids: list[str]):
        from ckan.lib.search import rebuild
        rebuild(package_ids=ids)
    def chunks(list_: list[str], n: int):
        u""" Yield n successive chunks from list_"""
        newn = int(len(list_) / n)
        for i in range(0, n - 1):
            yield list_[i * newn:i * newn + newn]
        yield list_[n * newn - newn:]
    processes = []
    try:
        for chunk in chunks(package_ids, mp.cpu_count()):
            process = mp.Process(target=start, args=(chunk,))
            processes.append(process)
            process.daemon = True
            process.start()
        for process in processes:
            process.join()
        commit()
    except Exception as e:
        error_shout(e)