【发布时间】:2012-08-06 04:36:20
【问题描述】:
在使用简单架构创建了一个 whoosh 索引并为 150 万条记录编制索引后,我在 15 秒内获得了接近 1000 个搜索结果。
schema = Schema(tax_id=STORED, name=TEXT(stored=True))
MAIN*.seg 文件的大小约为 190 Mb。
我的搜索方式如下
ix=open_dir("index")
with ix.searcher() as searcher:
query = QueryParser("name", ix.schema).parse(u'putrefaciens')
results = searcher.search(query)
我想知道这种性能是否符合预期,在给定索引大小的情况下,我们能否使用 whoosh 进行更快的全文搜索。
【问题讨论】:
-
由于 Whoosh 每次都在变化(为了更好),您正在/正在使用哪个版本?即使您的索引中有很多文档,这也是不可接受的性能,即使对于 Whoosh 也是如此。这不应超过 3(任意)秒。