CLI tool
apache/lucenenet avatar
apache/lucenenet

Apache Lucene.NET: a C# full-text search library still shipping 4.8 as a beta

Apache Lucene.NET is an open-source full-text search library written in C#, ported from the Apache Lucene project.

2,416 stars656 forksC#Apache-2.0

At a glance

What is it?
Lucene.NET is a C# port of Apache Lucene that gives .NET applications indexing, analysis and search without a separate server. The 3.0.3 line is the last stable release; the 4.8 line has been in beta since 2022 and is the one the repository is actively pushing.
Who is it for?
Adopt Lucene.NET 4.8 if you need embedded full-text search inside a .NET process and can live with a beta package that has been beta since 2022. Stay on 3.0.3 if your project requires a stable release line, and stay away entirely if you want a hosted search service with replication and a query DSL over HTTP.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 9 days ago.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Lucene.NET actually replaces in a .NET stack

Lucene.NET is not a search server. It is a library you reference from your own process, and the index it builds is a set of files on disk that only your code reads and writes. That distinction drives every other decision on this page.

The problem it solves is full-text search over text you already own: product catalogs, document stores, log archives, support tickets. The README describes it as providing "powerful indexing and search features, as well as spellchecking, hit highlighting and advanced analysis/tokenization capabilities." If you have ever written a LIKE '%term%' query against a relational database and watched it degrade as the table grew, that is the gap Lucene.NET fills, because it builds an inverted index instead of scanning rows.

The audience is .NET developers who want search inside their application rather than beside it. Because there is no server process, there is no network hop, no cluster to operate, and no separate deployment to keep in sync with your application version. The cost is that you own the index lifecycle yourself.

How indexing and search work in this port

The architecture follows Apache Lucene closely. Documents go in through an IndexWriter, text passes through an Analyzer that tokenizes and normalizes it, and the result is written to a Directory, which in practice is the filesystem-backed directory type. Queries are parsed or constructed, then run against an IndexSearcher over a reader opened on that directory. Scored hits come back as a TopDocs collection.

The port is not a wrapper around the Java code. It is a reimplementation in C#, and the repository carries MIGRATE.md, which signals that moving between major versions is a real task rather than a package bump. Release notes for the 4.8 line show the project tracking upstream Lucene 4.8 semantics while adapting them to .NET idioms.

Functionality beyond the core is split into separate NuGet packages rather than one large assembly. Faceting lives in Lucene.Net.Facet, result grouping in Lucene.Net.Grouping, keyword highlighting in Lucene.Net.Highlighter, joins in Lucene.Net.Join, and text-to-query parsing in Lucene.Net.QueryParser. Language-specific analysis is separate again: Lucene.Net.Analysis.Common for general analyzers, plus Lucene.Net.Analysis.SmartCn for Chinese, Lucene.Net.Analysis.Kuromoji for Japanese, Lucene.Net.Analysis.Morfologik and Lucene.Net.Analysis.Stempel for Polish, and Lucene.Net.Analysis.Phonetic for sounds-alike matching. You add only the ones you use.

Installing Lucene.NET and running a first query

The README gives two install paths, and which one you take depends on whether you accept a beta. For the stable 3.0.3 line, the documented command is the Package Manager console form:

bash
PM> Install-Package Lucene.Net

For the 4.8 line, the same command carries the pre-release flag, because every 4.8 package published so far is a beta:

bash
PM> Install-Package Lucene.Net -Pre

The equivalent dotnet CLI form is not shown in the README, so use the Package Manager syntax above or add the package through your IDE's NuGet UI. Once referenced, the basic flow is to create a directory-backed index, write documents through an IndexWriter, then open a searcher. The README does not include a complete end-to-end code sample, so the exact class names and constructor overloads should be taken from the API documentation linked from the project site rather than guessed.

If you need non-English analysis, add the matching package alongside the core library. For example, a Chinese-language index needs Lucene.Net.Analysis.SmartCn in addition to Lucene.Net, and the analyzer is then supplied to the IndexWriter configuration instead of the default one.

The 4.8 beta is the real limitation

The README is unusually candid about this. It states that the latest release version is Lucene.NET 3.0.3 and that the project is "Working toward Lucene.NET 4.8.0 (currently in BETA)." The 4.8 line has been in beta across three published pre-releases: beta00016 in February 2022, beta00017 in October 2024, and beta00018 in June 2026. That is a long beta, and it means the API surface can still change between pre-releases.

The README pushes back on the usual reading of that word, saying the beta version is "extremely stable," that it has more than 7800 passing unit tests, and that "some developers already use it in production environments." Those are the project's own claims, not an independent audit. The practical consequence is a versioning decision: you are either on 3.0.3, which is stable but targets .NET Framework 4.0 and 3.5 only, or on 4.8, which supports .NET 8.0, .NET 6.0, .NET Standard 2.1, .NET Standard 2.0 and .NET Framework 4.6.2 but is a pre-release package. There is no stable release that targets modern .NET.

A second limitation is operational. Because the index is local files, Lucene.NET gives you no replication, no sharding and no failover. If your application runs on multiple machines, each one either needs its own index or needs to read from a shared location, and the README does not document a distributed mode. Concurrency, lock handling and index corruption recovery are your responsibility. For a single-process desktop or service application this is fine; for a fleet of stateless web servers it is a design problem you have to solve before you write any search code.

Lucene.NET versus Elasticsearch and the other alternatives

The comparison people ask about most is Lucene.NET against Elasticsearch, and the difference is architectural rather than feature-by-feature. Elasticsearch is a server: you run it, you talk to it over HTTP, and it handles distribution, replication and cluster management for you. Lucene.NET is a library inside your process, with no HTTP layer at all. Choosing between them is really choosing whether you want to operate a search cluster or embed a search engine.

If you want the Elasticsearch model but with a .NET client, that is still Elasticsearch, not Lucene.NET. If you want something closer to a library but with a server wrapper, OpenSearch is the same family of trade-offs. The relevant point is that Lucene.NET sits below all of them: Elasticsearch itself is built on Apache Lucene, and Lucene.NET is the C# port of that same engine.

Within .NET, the alternative to adding a dependency is using what the database already offers. SQL Server full-text indexes, PostgreSQL's tsvector, or a LINQ query over a normalized table will handle small corpora without a new package. They fall over on relevance ranking, analyzers for non-English text, and faceting. Lucene.NET is the right call when those three things matter and a separate search service does not.

Licence, maintenance and what an upgrade costs

Lucene.NET is licensed under Apache-2.0, the same licence as upstream Apache Lucene. That is a permissive licence, and the repository carries both LICENSE.txt and NOTICE.txt, which is the standard Apache arrangement. The NOTICE file matters if you redistribute the library, because Apache-2.0 expects attribution to be preserved. This is a description of the licence terms, not legal advice; check with your own counsel if redistribution is part of your product.

On maintenance, the last push to the default branch was on 2026-06-22, the same day v4.8.0-beta00018 was released. The repository is not archived. The gap between beta00017 in October 2024 and beta00018 in June 2026 shows that releases arrive when they arrive rather than on a schedule.

The upgrade cost is concentrated in the major version boundary. The presence of MIGRATE.md in the repository root tells you the project treats 3.0.3 to 4.8 as a migration with documented steps, not a drop-in replacement. Within the 4.8 beta line, the risk is that a pre-release can change API between builds, so pinning an exact package version in your project file is the safer default than floating on the latest pre-release. Budget for reading MIGRATE.md before you start, not after your build breaks.

Editorial conclusion

Adopt Lucene.NET 4.8 if you need embedded full-text search inside a .NET process and can live with a beta package that has been beta since 2022. Stay on 3.0.3 if your project requires a stable release line, and stay away entirely if you want a hosted search service with replication and a query DSL over HTTP. Before committing, check that the analyzer package for your language exists in the 4.8 package list, confirm the target frameworks you build against (net8.0, net6.0, netstandard2.1, netstandard2.0, net462), and read MIGRATE.md if you are moving from 3.0.3.

Frequently asked questions

What is Lucene.NET used for?

It is an open-source full-text search library written in C#, ported from the Java Apache Lucene project. It provides indexing and search features along with spellchecking, hit highlighting and analysis/tokenization capabilities, running as a library inside your .NET application rather than as a separate server.

Is Apache Lucene still used?

The repository is not archived, and the last push to the default branch was on 2026-06-22, the same day v4.8.0-beta00018 was released. The README also states that some developers already use the 4.8 beta in production environments.

What is Lucene.NET?

It is a C# port of Apache Lucene, described in the README as an open-source full-text search library that runs everywhere .NET runs, including Windows, Unix, macOS, Android and iOS. The 4.8 line is still in beta, while 3.0.3 is listed as the latest release version.

How does Lucene.NET compare with Elasticsearch?

Elasticsearch is a server you run and query over HTTP, while Lucene.NET is a library embedded in your own process with the index stored as local files. Elasticsearch is itself built on Apache Lucene, so the two share an engine but differ in whether distribution and cluster management are handled for you.

What are the alternatives to Lucene.NET?

The README does not list alternatives, but the choice is usually between embedding a search library and running a search server. Database-native full-text features such as SQL Server full-text indexes or PostgreSQL's tsvector cover small corpora without adding a package, though they lack Lucene's relevance ranking, analyzers and faceting.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/apache-lucenenet.svg)](https://hysenlabs.com/projects/apache-lucenenet)