Also worth reading โ pick the right search engine:
ยท Whoosh vs SQLite FTS5
โ pure Python vs a built-in C extension, with real benchmark numbers.
ยท Whoosh vs Tantivy (tantivy-py)
โ pure Python vs Rust bindings: install story, speed, and portability.
Whoosh is a full-text search library for Python: ranked
results, a real query language, faceting, highlighting, and spell-correction โ
all in pure Python, with no compiler, no server, and no native dependencies.
pip install and go.
It was widely used, then went unmaintained. It was revived once as
whoosh-reloaded, then went quiet again. I'm picking it back up,
and this is the first release under new maintenance.
Update (3.0.3): the natural-language date parser now
accepts ISO-8601 dates (e.g. created:2023-05-17) instead of
choking on the - separators, so DateParserPlugin
works with the date format most apps already store. This release also adds a
compatibility test suite that guards the exact API surface downstream
projects rely on, so future changes can't silently break them.
pip install -U whoosh3.
Update (3.0.2): another patch release, fixing two real
correctness bugs. First: a filter=/mask= set was
silently ignored whenever a search also had a time limit, so a filtered,
time-limited search returned every matching document. Second:
sorting or faceting by a column field returned scrambled results after
documents were added through a BufferedWriter. Both come with
regression tests. pip install -U whoosh3.
Update (3.0.1): a patch release fixes a real correctness
bug from the upstream backlog โ NumericRange with an open lower
bound could match every document instead of the intended range (an
underflow in the trie-range splitter that hit unsigned NUMERIC
fields). It's fixed with an exhaustive regression test. pip install -U
whoosh3.
What's new in the 3.0.0 revival
- Zero runtime dependencies. Dropped
loguruandcached-property(now stdlibfunctools.cached_property). A truly pure-Python, no-compile install that works anywhere CPython runs โ including PyPy and the browser via Pyodide. - Modern packaging (PEP 621) and a CI matrix across Python 3.9โ3.13.
- Two long-standing bugs fixed, each with a regression test:
MultiFilterno longer throwsStopIterationon empty token streams.RamStorageno longer secretly writes to/tmpโ in-memory indexes now stay in memory, fixing those intermittent "No such file" errors.
- A live, in-browser demo (Pyodide) so you can try search without installing anything.
- A reproducible benchmark vs SQLite FTS5 in
examples/, with honest caveats โ FTS5 (a C extension) is faster and smaller; Whoosh is what you reach for when you want real search inside a Python process with no extra infrastructure and full programmability. - A did-you-mean / spell-check demo โ Whoosh has built-in spelling correction straight off the index, and most people never discover it.
- A search-as-you-type / autocomplete example โ three pure-Python strategies (term completion, prefix search, and fuzzy n-gram matching) for the single most-requested search feature.
- A migration guide for existing Whoosh / whoosh-reloaded users โ upgrading is a one-line dependency change; imports, on-disk index format, and the public API are unchanged.
- Honest docs and a public roadmap. I'd rather under-promise.
Try it in 30 seconds
from whoosh.fields import Schema, TEXT, ID
from whoosh.filedb.filestore import RamStorage
from whoosh.qparser import QueryParser
ix = RamStorage().create_index(Schema(path=ID(stored=True), body=TEXT))
w = ix.writer(); w.add_document(path="/a", body="the quick brown fox"); w.commit()
with ix.searcher() as s:
q = QueryParser("body", ix.schema).parse("quick fox")
print([hit["path"] for hit in s.search(q)]) # ['/a']
Install it with pip install whoosh3. Or don't install anything
and run the live browser demo first.
Why pure-Python search still matters in 2026
The obvious question: why not just use a C extension like SQLite FTS5, or a managed service? Sometimes you should โ and the benchmark in the repo is honest about where FTS5 wins. But there's a large middle ground where you want real ranked search inside a Python process: no extra service to run, no native build step in your Docker image or serverless function, full programmability of analyzers and scoring, and the ability to run the exact same code on your laptop, your server, PyPy, or WebAssembly. That's the niche Whoosh has always filled, and it's why the library kept getting used long after it stopped being maintained.
Credit where it's due
Whoosh was created by Matt Chaput and later carried by the
whoosh-reloaded maintainers (Sygil-Dev). This continuation
preserves their copyright and BSD-2-Clause license. Thank you.
Issues and PRs are welcome โ I aim to respond promptly and kindly.
โญ Star Whoosh on GitHub ยท Join the discussion ยท Live demo