I use whoosh backend with jieba analyzer. And use sqlalchemy link to mysql.
I use flask-apscheduler to perform update whoosh index tasks regularly. Code like blow:
@scheduler.task('cron', id='do_refresh_whoosh_index', hour=2)
def refresh_whoosh_index():
app = scheduler.app
with app.app_context():
search.update_index()
The first time to update index is very quick( no index file yet), thousands rows per second. But when update_index run again, it will be very slow, about just 10 rows per second. I have to delete the index, and recreate.
Is there another solution? Or I made some mistake?
Thanks!
I use
whooshbackend withjiebaanalyzer. And usesqlalchemylink tomysql.I use
flask-apschedulerto perform update whoosh index tasks regularly. Code like blow:The first time to update index is very quick( no index file yet), thousands rows per second. But when
update_indexrun again, it will be very slow, about just 10 rows per second. I have to delete the index, and recreate.Is there another solution? Or I made some mistake?
Thanks!