xpleaf / Blog_mini

An Open Source Blog System that developed with Flask.
Other
982 stars 469 forks source link

[ok] now the fulltext search(FTS) of blog article works well. support chinese FTS(新增全文搜索功能) #4

Open kerneltravel opened 8 years ago

kerneltravel commented 8 years ago

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

kerneltravel commented 8 years ago

requirements.txt should updated to:

-r requirements/common.txt gunicorn==19.4.5 psycopg2==2.6.1 Flask-WhooshAlchemyPlus>=0.7.4

xpleaf commented 8 years ago

@kerneltravel 非常感谢你的奉献,但我以最新一次提交测试时,发现下面的几个问题:

kerneltravel commented 8 years ago

好的,收到

kerneltravel commented 8 years ago

搜索后显示不出文章内容,因为新工程目录内数据库的文章(某种操作后)还没在whoosh_index生成对应的索引信息,就搜索不到。 而用mysql 做中文全文索引就没有这个问题,mysql5.7做全文索引就不用去额外维护文件了,所以mysql的全文搜索方案更方便些。