对日志的读/写和查询性能的主要改进。
已将默认日志限制(运行大小)从4 MB更改为32 MB。
已完成将后端特定代码迁移到 whoosh.filedb
包裹。
将格式从whoosh.fields模块移到新的whoosh.formats模块中。
DocReader and TermReader classes combined into new IndexReader interface. You can get an IndexReader implementation by calling Index.reader(). Searcher is now a wrapper around an IndexReader.
范围查询对象已更改,默认查询分析器中有新的签名和新的语法。现在你可以使用 [start TO end]
在包含范围的查询分析器中,以及 {{start TO end}}
独家专享。例如,您还可以混合分隔符 [start TO end}}
对于包含开始但不包含结束术语的范围。
添加的实验日期时间字段类型允许您传递 datetime.datetime
对象作为字段值 add_document
::
from whoosh.fields import Schema, ID, DATETIME
from whoosh.filedb.filestore import RamStorage
from datetime import datetime
schema = Schema(id=ID, date=DATETIME)
storage = RamStorage()
ix = storage.create_index(schema)
w = ix.writer()
w.add_document(id=u"A", date=datetime.now())
w.close()
在内部,datetime字段使用格式(4位年份+2位月份+2位日期+t'+2位小时+2位分钟+2位秒+6位微秒)将datetime对象索引为文本,例如 20090817T160203109000
.
默认的查询分析器现在允许您在前缀和范围查询中使用带引号的字符串,例如 ["2009-05" TO "2009-12"]
, "alfa/bravo"*
,使包含特殊字符的术语更容易使用。
DocReader.vector_as(docnum, fieldid, astype)
现在是 IndexReader.vector_as(astype, docnum, fieldid)
(例如,astype参数已从最后一个参数移动到第一个参数),例如 v = ixreader.vector_as("frequency", 102, "content")
.
添加了whoosh.support.charset来翻译sphinx charset表文件。
添加whoosh.analysis.charsettokenezer和charsetfilter以启用大小写和重音折叠。
添加实验 whoosh.ramdb
内存后端。
添加实验 whoosh.query.FuzzyTerm
查询类型。
补充 whoosh.lang.wordnet
模块包含 Thesaurus
用于使用WordNet同义词数据库的对象。