如何实现新的后端

索引

IndexWriter

  • 子类 whoosh.writing.IndexWriter .

  • 索引编写器必须实现以下方法。

  • 支持删除的后端必须实现以下方法。

  • 作为事务处理的索引编写器必须实现以下方法。

    • whoosh.reading.IndexWriter.commit() --将使用此索引编写器完成的添加/删除操作保存到主索引,并释放索引编写器使用的任何资源。

    • whoosh.reading.IndexWriter.cancel() --放弃使用此索引编写器进行的任何添加/删除操作,并释放索引编写器使用的任何资源。

IndexReader

匹配器

这个 whoosh.reading.IndexReader.postings() 方法返回 whoosh.matching.Matcher 对象。您可能需要实现一个自定义的matcher类,以便从您的发布列表中进行读取。