Apache Lucene

active

by 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.

search enginevectorspatialembedded libraryopen source (permissive)mature

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

✓Full-text search
✓Vector search
✓Geospatial
✓Columnar storage
✓Durable persistence
✓Compression
–Transactions
–Joins
–Secondary indexes
–JSON
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–In-memory
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

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

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

apis & protocolsJava
client languagesJava, Kotlin, Scala

Alternatives to Apache Lucene

Compare all→
TantivySearch Engine22.6

Lucene-inspired full-text search library in Rust, the engine under Quickwit and ParadeDB.

apache-lucene vs tantivy →
BleveSearch Engine12.2

Pure-Go full-text, geo and vector indexing library from Couchbase.

apache-lucene vs bleve →
ElasticsearchSearch Engine75.1

Lucene-based distributed search and analytics engine for text, vectors, logs and metrics.

apache-lucene vs elasticsearch →
Apache SolrSearch Engine39.8

The original Lucene search server: battle-tested, Apache-governed, now with GPU-accelerated vectors.

apache-lucene vs apache-solr →
OpenSearchSearch Engine56.6

Apache-licensed, foundation-governed fork of Elasticsearch for search, vectors and observability.

apache-lucene vs opensearch →
AlgoliaSearch Engine54.3

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.