Apache Lucene
activeby Apache Software Foundation · since 1999 · also known as Lucene
The Java search library at the heart of Elasticsearch, OpenSearch and Solr, now with HNSW vectors.
Overview
Lucene is the Apache Software Foundation's Java library for inverted-index search, first written by Doug Cutting in 1999 and still the engine inside Elasticsearch, OpenSearch and Solr. It provides analyzers, BM25 and other similarities, points for numeric and geo data, doc values for sorting and aggregations, and since 9.0 HNSW vector indexes with scalar and binary quantization. Lucene 10 brought better concurrency and I/O, and the 10.5 line continues to improve vector and query performance. Use it directly when you need search embedded in a JVM application with full control; otherwise use one of the servers built on it.
Strengths & trade-offs
Strengths
- +Two decades of relevance and performance engineering
- +HNSW vectors with int4/int8/binary quantization
- +Doc values, points and geo shapes for rich filtering and sorting
- +Foundation of the biggest search engines
- +Apache governance
Trade-offs
- −Library only: no networking, replication or cluster management
- −Low-level API with a steep learning curve
- −JVM required
- −Frequent major-version index format changes
Great for
- +Embedding search in JVM applications
- +Building custom search servers
- +Desktop and IDE search features
- +Research on retrieval algorithms
Think twice for
- −Teams wanting a hosted or server search engine
- −Non-JVM stacks
- −Quick prototypes
Capabilities
Native or official first-party support · 6 of 25 tracked
Scale & consistency
- Comfortable data size
- Large · ≤ 1 PB
- Horizontal scaling
- Manual
- Multi-region
- No
- Transactions
- Limited ACID
- Consistency
- Strong
- Schema
- Flexible
- Architecture
- Embedded
- Query languages
- Lucene query syntax, Java API
A single index can hold billions of documents; distribution comes from Elasticsearch, OpenSearch or Solr.
Deployment
Ecosystem
Alternatives to Apache Lucene
Lucene-inspired full-text search library in Rust, the engine under Quickwit and ParadeDB.
apache-lucene vs tantivy →Pure-Go full-text, geo and vector indexing library from Couchbase.
apache-lucene vs bleve →Lucene-based distributed search and analytics engine for text, vectors, logs and metrics.
apache-lucene vs elasticsearch →The original Lucene search server: battle-tested, Apache-governed, now with GPU-accelerated vectors.
apache-lucene vs apache-solr →Apache-licensed, foundation-governed fork of Elasticsearch for search, vectors and observability.
apache-lucene vs opensearch →Hosted search-as-a-service with fast typo-tolerant search, merchandising and AI ranking.
apache-lucene vs algolia →Apache Lucene FAQ
What is Apache Lucene?
Apache Lucene is a search engine database by Apache Software Foundation, first released in 1999. Lucene is the Apache Software Foundation's Java library for inverted-index search, first written by Doug Cutting in 1999 and still the engine inside Elasticsearch, OpenSearch and Solr. It provides analyzers, BM25 and other similarities, points for numeric and geo data, doc values for sorting and aggregations, and since 9.0 HNSW vector indexes with scalar and binary quantization. Lucene 10 brought better concurrency and I/O, and the 10.5 line continues to improve vector and query performance. Use it directly when you need search embedded in a JVM application with full control; otherwise use one of the servers built on it.
Is Apache Lucene open source?
Yes. Apache Lucene is open source. License: Apache License 2.0.
Does Apache Lucene support ACID transactions?
Partly. Apache Lucene offers limited ACID guarantees (for example, single-record or single-partition transactions), with strong consistency.
Does Apache Lucene scale horizontally?
Apache Lucene has no built-in sharding; scaling out means partitioning data in your application. It is comfortable at large scale (≤ 1 PB).
How can I run Apache Lucene?
You can self-host it and embed it in your application.
What is Apache Lucene best for?
Apache Lucene is a strong fit for embedding search in JVM applications; building custom search servers; and desktop and IDE search features. Think twice for teams wanting a hosted or server search engine.
What are the best alternatives to Apache Lucene?
Common alternatives to Apache Lucene include Tantivy, Bleve, Elasticsearch, Apache Solr and OpenSearch. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
How popular is Apache Lucene?
Apache Lucene ranks #50 of 844 databases on the WhichDB Score (38.6/100), and #6 among search engine databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.