Open-source search database supporting full-text, vector and hybrid search with real-time indexing and SQL, positioned as an Elasticsearch alternative.
quickwit-oss/tantivy
A full-text search engine library in Rust, inspired by Apache Lucene, for building custom search into applications.
Open-source alternative to:Elasticsearch
Apache Solr
- Stars
- 16,247
- Forks
- 1,017
- Open issues
- 484
- Last commit
- 22 hours ago
What is it?
Tantivy is a Rust crate for building full-text search into your own software. It is not a standalone search server; instead, developers use its API to define schemas, index documents, and run queries. Its design follows Apache Lucene closely, and it uses BM25 scoring, which matches Lucene's ranking.
The library covers the usual search building blocks: configurable tokenizers with stemming for 17 Latin-script languages, phrase and range queries, a natural query language with AND/OR operators, and faceted search. Fields can be text, integers, floats, dates, IP addresses, booleans, or JSON, and fast fields work like Lucene doc values. Documents can be stored with LZ4, Zstd, or no compression, and an aggregation collector provides histograms, range buckets and basic statistics.
Tantivy supports incremental indexing and multithreaded indexing, and it starts in under 10 ms, which suits command-line tools. For Chinese and Japanese tokenization, the project links to third-party tokenizer crates. It runs on stable Rust across Linux, macOS, and Windows.
Key features
- 01BM25 scoring, the same ranking as Lucene
- 02Configurable tokenizers with stemming for 17 Latin-script languages
- 03Phrase, range, and natural-language boolean queries
- 04Incremental and multithreaded indexing
- 05Fast fields, faceted search, and aggregations
- 06Compressed document store with LZ4, Zstd, or no compression
Use cases
- Adding full-text search to a Rust application without running a separate server
- Building a custom command-line search tool with fast startup
- Indexing email or message archives for local search
- Embedding a search engine in a service that needs Lucene-style querying
Quick start
- 1
Clone the repository
git clone https://github.com/quickwit-oss/tantivy.git - 2
Enter the project directory
cd tantivy - 3
Run the tests with Cargo (stable Rust)
cargo test
Things to know
- It is a Rust library, not a ready-to-run search server, so you must build your own search application around it.
- Distributed search is out of scope; use Quickwit for that.
- Documents are immutable, so editing one means deleting and reindexing it.
- Chinese and Japanese tokenization relies on third-party crates.
Topics
FAQ
- What is tantivy?
- A full-text search engine library in Rust, inspired by Apache Lucene, for building custom search into applications. Tantivy is a Rust crate for building full-text search into your own software. It is not a standalone search server; instead, developers use its API to define schemas, index documents, and run queries. Its design follows Apache Lucene closely, and it uses BM25 scoring, which matches Lucene's ranking.
- Is tantivy free to use? What license does it have?
- tantivy is open source under the MIT license. Check the license terms before using it in commercial products.
- Is tantivy still maintained?
- Actively maintained. The last commit to tantivy was on Oct 21, 2026.
- What can I use tantivy for?
- Adding full-text search to a Rust application without running a separate server Building a custom command-line search tool with fast startup Indexing email or message archives for local search Embedding a search engine in a service that needs Lucene-style querying
- How do I install tantivy?
- Clone the repository: git clone https://github.com/quickwit-oss/tantivy.git Enter the project directory: cd tantivy Run the tests with Cargo (stable Rust): cargo test
- Where can I get tantivy?
- The source code and installation instructions are on GitHub: https://github.com/quickwit-oss/tantivy
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A lightweight, single-binary full-text search engine written in Go, offered as a simpler alternative to Elasticsearch for app search.
A high-performance, full-featured text search engine library written in Java, used as the foundation for building search applications.
A Redis module that adds full-text, secondary indexing, vector similarity and aggregation queries to Redis data.
Apache Solr is an open-source, multi-modal search platform built on Apache Lucene for full-text, vector, and geospatial search.
A Postgres extension that adds full-text search, vector search, BM25 scoring and aggregations to your existing Postgres database.