
Anserini
Lucene toolkit for reproducible IR research and production search.
Replaces Elastic Elasticsearch

Who it's for
Anserini provides prebuilt indexes for MS MARCO, BEIR, and TREC collections with documented reproduction scripts, so researchers can test a new retrieval model against standard datasets and verify that their reported numbers match the reference baselines independently.
Your work focuses on neural re-ranking with no sparse retrieval component. Pyserini extends to some dense retrieval cases, but Anserini's strongest value is sparse and hybrid retrieval experiments on standard IR benchmarks.
Teams migrating from a commercial search deployment can use Anserini to test retrieval effectiveness on their documents against established academic baselines. The shared Lucene core means BM25 behavior is consistent between Anserini experiments and a production Elasticsearch or OpenSearch index.
You need a full production search service with REST query APIs, distributed indexing, and monitoring out of the box. Anserini is not a drop-in replacement for Elasticsearch: it is a research toolkit, not a managed search server.
The fatjar install and prebuilt indexes make Anserini accessible in a course environment without requiring students to compile from source. The SIGIR 2017 and JDIQ 2018 papers provide peer-reviewed methodology references that connect coursework to published IR research.
Your course uses Python exclusively and has no Java requirement. Pyserini is the recommended entry point for Python-first curricula and covers most of the same retrieval experiments.
The problem
Information retrieval research depends on reproducibility: a retrieval model published in a paper should produce the same rankings when anyone else runs it. In practice, most academic IR systems are written in bespoke Python or C++ code, tied to a specific dataset version, and impossible to run outside the original lab. This makes it hard to build on prior work, compare new models fairly, or trust that a paper's reported numbers reflect the actual system. The pain sharpens when moving from research to production. Lucene powers the majority of commercial and open source search infrastructure, yet most IR research runs on retrieval engines with no connection to Lucene. Teams that want to bring a research-grade retrieval model into a Lucene-based production system often have to reimplement the whole thing from scratch, which reintroduces the reproducibility problem the original research was meant to solve.
How it works
Anserini ships as a prebuilt fatjar with all Lucene 10.5 dependencies bundled. Download it once and run Lucene indexing and search without compiling source or managing a Maven build. The same jar works on any JVM-capable host, so there is no environment-specific setup required.
Ready-to-use prebuilt indexes cover common IR test collections including MS MARCO, BEIR, and TREC datasets. Researchers can reproduce published retrieval experiments without re-indexing from raw collections, which saves hours of preprocessing time for each experimental run.
Direct access to Apache Lucene 10's indexing and search API, including BM25 and query-expansion retrieval. The same code path runs both controlled research experiments and production Lucene stacks, so a model proven on a benchmark transfers cleanly to a deployed Lucene application.
Most Anserini retrieval functionality is available through Pyserini, a Python library wrapping the Java toolkit. Researchers who prefer Python can run the same benchmarks and obtain the same rankings as the Java path, without writing any Java code.
Every experiment in the codebase ships with a documented reproduction script and reference effectiveness numbers. Contributors and reviewers can verify that a code change has not silently broken a retrieval model's accuracy, which is the core commitment of the reproducibility-first design.
Features
- Self-contained fatjar install
- Prebuilt indexes for standard IR benchmarks
- Lucene 10 retrieval primitives
- Pyserini Python interface
- Documented reproduction scripts with reference numbers
Recommended for this setup
Strengths
- Apache-2.0 permissive license: Anserini is Apache-2.0 licensed, an OSI-approved permissive license. You can run it in commercial applications, modify the source, and distribute modified versions without triggering copyleft obligations and without paying any licensing fee. Unlike Elasticsearch's commercial license, there are no restrictions on research or internal use.
- Peer-reviewed academic pedigree: Anserini has publications at SIGIR 2017 and in the Journal of Data and Information Quality (2018), and continues active development with 1,238 GitHub stars, 771 forks, and a last commit in November 2026. The castorini research group has sustained reproducibility benchmarks for over a decade, making the codebase a credible academic reference.
- Same Lucene core as production search platforms: Because Anserini runs on the Apache Lucene library that also powers Elasticsearch and OpenSearch, retrieval models prototyped in Anserini benchmarks can migrate into production Lucene infrastructure without reimplementing the retrieval logic. The overlap in the retrieval engine means benchmark results translate directly.
Trade-offs
- No production search API or cluster mode: Anserini is a command-line and programmatic research toolkit, not a search server. It has no REST API, no index replication, and no distributed cluster mode. Teams that need a queryable HTTP endpoint, real-time document updates at scale, or multi-node search must use Elasticsearch or OpenSearch instead.
- Java core required for full functionality: Anserini's command-line tools and source-level customization require a JDK. The Pyserini Python interface covers most retrieval features, but researchers who need Java-only tools or want to modify the retrieval pipeline will need a Java development environment. Teams with no Java experience may find the Maven build setup takes time.
- Upstream evaluation tooling restructured in 2026: The README notes that the eval repository's topics-and-qrels directory structure was refactored in August 2026, breaking consumers relying on stable paths from the master branch. Teams building automated pipelines on top of Anserini should pin to specific commits rather than following master to avoid unexpected breakage.
Tech stack
FAQ
The simplest path is the fatjar: the README describes downloading a prebuilt JAR via curl, with no Maven build or source checkout required. The installation guide at docs/installation-fatjar.md in the repo covers the exact command and steps. For a full development environment that supports source changes and all tests, docs/installation-dev.md covers the Maven-based path. Most retrieval features are also available through Pyserini for researchers who prefer Python.
Yes, the core toolkit is Java. The fatjar requires a JVM to run, but no JDK or Maven is needed for basic retrieval use. For source-level development, a JDK and Maven are required. If you prefer Python, Pyserini wraps Anserini's Java core in a Python library and covers most retrieval features, so many researchers interact with Anserini entirely through Python without writing any Java.
Both tools use Apache Lucene, but they serve completely different purposes. Elasticsearch is a production search and analytics platform with REST APIs, distributed clustering, and commercial managed hosting. Anserini is a research toolkit for reproducible IR experiments: no REST API, no clustering, no managed tier. Teams running IR benchmarks and experiments use Anserini; teams that need a deployable search service with query APIs use Elasticsearch or OpenSearch.
Anserini includes prebuilt indexes and reproduction scripts for major IR test collections including MS MARCO, BEIR, and TREC datasets. The repo's documentation provides reference effectiveness numbers so researchers can verify that a reproduction matches the published baselines, which is central to the reproducibility-first design. The onboarding path at docs/start-here.md in the repo walks through the first experiments.
No. Anserini is a command-line and programmatic research toolkit, not a search server. It has no REST API endpoint, no index replication, and no cluster mode. For production search, Elasticsearch or OpenSearch are the natural options. Because all three share the same Lucene retrieval engine, a retrieval model prototyped in Anserini can be carried into a production Lucene deployment without reimplementing the core logic.