Section navigation
Note

This page is generated from README.md. Edit the repository file, not this copy.

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.

Note

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).
Tip

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.

Important

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.