烧瓶Whooshe索引为空

时间:2018-07-25 13:42:42

标签: python full-text-search whoosh

我似乎无法让Flask-Whooshee为我的数据库建立索引。我的索引文件夹上只有一个_MAIN_0.toc。

这是我的代码:

from flask_whooshee import Whooshee
app = Flask(__name__)
APP_DIR = os.path.dirname(os.path.realpath(__file__))

app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://user:pass@127.0.0.1/testdb'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True

ws = Whooshee(app)

@ws.register_model('title')
class posts_videos(db.Model):
__tablename__ = 'posts_videos'

id = db.Column('id', db.Integer, primary_key=True)
title = db.Column('title', db.Unicode)
category = db.Column('category', db.Unicode)
tags = db.Column('tags', db.Unicode)
duration = db.Column('duration', db.Integer)
hd = db.Column('hd', db.Integer)
thumbnail = db.Column('thumbnail', db.Unicode)
url1 = db.Column('url1', db.Unicode)
url2 = db.Column('url2', db.Unicode)
linktype = db.Column('linktype', db.Unicode)
releasedate = db.Column('releasedate', db.Unicode)

0 个答案:

没有答案