LeanCorpus 3.1.0

Prefix Reserved
dotnet add package LeanCorpus --version 3.1.0
                    
NuGet\Install-Package LeanCorpus -Version 3.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LeanCorpus" Version="3.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LeanCorpus" Version="3.1.0" />
                    
Directory.Packages.props
<PackageReference Include="LeanCorpus" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LeanCorpus --version 3.1.0
                    
#r "nuget: LeanCorpus, 3.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LeanCorpus@3.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LeanCorpus&version=3.1.0
                    
Install as a Cake Addin
#tool nuget:?package=LeanCorpus&version=3.1.0
                    
Install as a Cake Tool

LeanCorpus Monorepo

Build NuGet Native AOT Documentation Changelog

3.x and 4.x Roadmap .NET 11 Plan

LeanCorpus is an embeddable, segment-centric full-text search engine for modern .NET. It provides indexing, search, vector retrieval, typed mapping, optional compression and observability without requiring a separate search service.

The core package targets net10.0 and net11.0. It has no external runtime dependencies and is designed for Native AOT.

Install the core package:

dotnet add package LeanCorpus

Create an index, add a document and search it:

using Rowles.LeanCorpus.Document;
using Rowles.LeanCorpus.Document.Fields;
using Rowles.LeanCorpus.Index.Indexer;
using Rowles.LeanCorpus.Search.Queries;
using Rowles.LeanCorpus.Search.Searcher;
using Rowles.LeanCorpus.Store;

using var directory = new MMapDirectory("./my-index");
using var writer = new IndexWriter(directory, new IndexWriterConfig());

var document = new LeanDocument();
document.Add(new StringField("id", "1"));
document.Add(new TextField("title", "The quick brown fox"));
writer.AddDocument(document);
writer.Commit();

using var searcher = new IndexSearcher(directory);
var results = searcher.Search(new TermQuery("title", "fox"), topN: 10);

Console.WriteLine($"Found {results.TotalHits} document(s).");

The program creates ./my-index and prints:

Found 1 document(s).

Start with Installation and first index, then learn when to use each field type.

Choose the package that matches your job

I want to... Package Start here
Embed indexing and search in a .NET application LeanCorpus First index
Tokenise, analyse or stem text without the search engine Rowles.Text Rowles.Text README
Generate typed, reflection-free document mappings LeanCorpus.SourceGen SourceGen README
Use fast LZ4 stored-field compression LeanCorpus.Compression.LZ4 LZ4 README
Use Snappy stored-field compression LeanCorpus.Compression.Snappy Snappy README
Use Zstandard stored-field compression LeanCorpus.Compression.Zstandard Zstandard README

The core package already includes Deflate and Brotli. Add a compression package only when its speed or size trade-off fits your workload.

Choose your next path

Native AOT

Validate Native AOT paths in the repository with:

./devops aot

Optional compression packages normally register themselves through module initialisers. Native AOT applications should call the package's Register() method explicitly at startup.

LeanCorpus does not support Blazor WebAssembly. Its segment-centric design requires filesystem and memory-mapped I/O. Blazor Server and Blazor Hybrid remain suitable when indexing and search run server-side.

Monorepo map

Path Purpose
src/core/Rowles.LeanCorpus Core indexing, search, storage and codec implementation
src/core/Rowles.Text Canonical text-analysis source and standalone package
src/core/Rowles.LeanCorpus.SourceGen Typed mapping source generator
src/core/Rowles.LeanCorpus.Compression.* Optional compression packages
src/server Pre-release server contracts, core and ASP.NET Core host
src/devops Tests, benchmarks, CLI and profiling projects
src/examples Runnable examples and end-to-end workloads
docs DocFX documentation source
lexicons Language data and generated lexicon assets

Plans and discussion

The public roadmap is developed in GitHub Discussions:

Quality

Quality Gate Coverage Maintainability

LeanCorpus is licensed under the repository LICENCE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on LeanCorpus:

Package Downloads
LeanCorpus.Compression.Zstandard

Zstandard stored-field compression codec for LeanCorpus.

LeanCorpus.Compression.Snappy

Snappy stored-field compression codec for LeanCorpus.

LeanCorpus.Compression.LZ4

LZ4 stored-field compression codec for LeanCorpus.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.0 0 9/3/2026
3.0.0 90 8/25/2026
2.3.0 104 8/8/2026
2.2.0 106 8/8/2026
2.1.1 112 7/26/2026
2.1.0 113 7/25/2026
2.0.0 122 7/14/2026
1.4.2 279 6/25/2026
1.4.1 162 6/13/2026
1.4.0 111 5/29/2026
1.3.0 138 5/11/2026