Registry / devops / pyserini

pyserini

JSON →
library2.2.0pypypiunverified

A Python toolkit for reproducible information retrieval research with sparse and dense representations. Current version: 2.2.0 (requires Python >=3.12). Released on PyPI; active development on GitHub by Castorini group.

pip install pyserini
INSTALL
IMPORT
SIG · PYSERINI
P
pyserini
devopspythonv2.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LuceneSearcher
from pyserini.search import LuceneSearcher
from pyserini.search.lucene import LuceneSearcher

Search using a pre-built index (Robust04).

from pyserini.search.lucene import LuceneSearcher searcher = LuceneSearcher.from_prebuilt_index('robust04') hits = searcher.search('hubble space telescope') for i, hit in enumerate(hits[:3]): print(f'{i+1:2} {hit.docid:15} {hit.score:.5f}')
Debug
Known issues
breakingPyserini 2.0+ requires Python 3.12 and drops Python 3.8-3.11. The API has been reorganized: all search classes moved to pyserini.search.lucene and index classes to pyserini.index.lucene.
fix
Update imports: from pyserini.search.lucene import LuceneSearcher (instead of pyserini.search.SimpleSearcher).
affects: <2.0 -> >=2.0
gotchaThe built-in tokenizer in LuceneSearcher may not handle text normalization as expected; always check query analysis.
fix
Set custom analyzer if needed: searcher.set_analyzer(MyAnalyzer()).
affects: all
Upgrade
Version history
2.2.0latest on PyPI · released Jun 3, 2026
Audit
Dependencies
torchoptionalRequired for dense retrieval models (e.g., DPR, Contriever)
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
pyserini — pip install pyserini · libregistry