Blog_mini
Blog_mini copied to clipboard
[ok] now the fulltext search(FTS) of blog article works well. support chinese FTS(新增全文搜索功能)
to FTS the articles's title/summary/contens. use python's Flask-WhooshAlchemy+jieba tokenizer. based on Flask-WhooshAlchemyPlus . Note the Flask-WhooshAlchemyPlus V 0.7.4 should update flask_whooshalchemyplus.py's line 151 return self.filter('null') with return self.filter(sqlalchemy.text('null')) in case of this issue
requirements.txt should updated to:
-r requirements/common.txt gunicorn==19.4.5 psycopg2==2.6.1 Flask-WhooshAlchemyPlus>=0.7.4
@kerneltravel 非常感谢你的奉献,但我以最新一次提交测试时,发现下面的几个问题:
- 不输入内容搜索会出现
werkzeug.routing.BuildError
错误 - 文章点击进去后显示
whoosh.fields.UnknownFieldError
错误 - 搜索后显示不出文章内容
- 另外对于账户的管理没有界面 希望可以跟进一下。
好的,收到
搜索后显示不出文章内容,因为新工程目录内数据库的文章(某种操作后)还没在whoosh_index生成对应的索引信息,就搜索不到。 而用mysql 做中文全文索引就没有这个问题,mysql5.7做全文索引就不用去额外维护文件了,所以mysql的全文搜索方案更方便些。