How to implement a new backend

Index

IndexWriter

  • Subclass whoosh.writing.IndexWriter.
  • IndexWriters must implement the following methods.
  • Backends that support deletion must implement the following methods.
  • IndexWriters that work as transactions must implement the following methods.
    • whoosh.reading.IndexWriter.commit() – Save the additions/deletions done with this IndexWriter to the main index, and release any resources used by the IndexWriter.
    • whoosh.reading.IndexWriter.cancel() – Throw away any additions/deletions done with this IndexWriter, and release any resources used by the IndexWriter.

IndexReader

Matcher

The whoosh.reading.IndexReader.postings() method returns a whoosh.matching.Matcher object. You will probably need to implement a custom Matcher class for reading from your posting lists.