# Tantivy

> A full-text search engine library written in Rust, inspired by Apache Lucene, for building custom search engines.

Tantivy is an open-source full-text search engine library written in Rust and maintained under the quickwit-oss GitHub organization. It is inspired by Apache Lucene's design and is meant to be embedded in applications to build search functionality. The latest listed release is 0.26.1, published 2026-05-10.

## What It Is

Tantivy is a crate rather than an off-the-shelf search server. The README says it is closer to Apache Lucene than to Elasticsearch or Apache Solr, and is intended as a building block for such engines. Distributed search is explicitly out of scope; the README points to Quickwit, a distributed search engine built on Tantivy, for that need.

## How Indexing and Search Work

Developers define a schema, index documents, and query them. Supported field types include text, integers, floats, dates, IP, bool, JSON, and hierarchical facets. Queries use a natural query language such as `(michael AND jackson) OR "king of pop"`, with phrase and range queries and BM25 scoring (the same as Lucene). Indexing is incremental and multithreaded. Documents are immutable, so edits require deleting and reindexing. New documents become searchable after a commit on the IndexWriter and a reader reload.

## Features for Analysis and Language Support

The library offers faceted search, an aggregation collector (histogram, range buckets, average, stats), fast fields (the equivalent of Lucene doc values), and a compressed document store (LZ4, Zstd, or none). The tokenizer is configurable with stemming for 17 Latin languages, and third-party crates add Chinese, Japanese, and Korean tokenization.

## Getting Started

Tantivy works on stable Rust and supports Linux, macOS, and Windows. The project provides a basic search example, docs on docs.rs, and tantivy-cli, a command-line tool for creating an index and searching via the CLI or a small REST server. Bindings exist for Python (tantivy-py) and Ruby (tantiny).

## Features
- Full-text search
- Configurable tokenizers with stemming for 17 Latin languages
- BM25 scoring
- Natural query language and phrase queries
- Range queries and faceted search
- Incremental and multithreaded indexing
- Mmap directory
- Fast fields
- JSON field support
- Aggregation collector (histogram, range, average, stats)
- Compressed document store (LZ4, Zstd)
- Searcher Warmer API

## Integrations
tantivy-py, tantiny, tantivy-cli, Quickwit, tantivy-jieba, lindera

## Platforms
WINDOWS, MACOS, LINUX, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
0.26.1

## Links
- Website: https://github.com/quickwit-oss/tantivy
- Documentation: https://docs.rs/tantivy/
- Repository: https://github.com/quickwit-oss/tantivy
- EveryDev.ai: https://www.everydev.ai/tools/tantivy
