LeanCorpus 3.1.0
Prefix Reserveddotnet add package LeanCorpus --version 3.1.0
NuGet\Install-Package LeanCorpus -Version 3.1.0
<PackageReference Include="LeanCorpus" Version="3.1.0" />
<PackageVersion Include="LeanCorpus" Version="3.1.0" />
<PackageReference Include="LeanCorpus" />
paket add LeanCorpus --version 3.1.0
#r "nuget: LeanCorpus, 3.1.0"
#:package LeanCorpus@3.1.0
#addin nuget:?package=LeanCorpus&version=3.1.0
#tool nuget:?package=LeanCorpus&version=3.1.0
LeanCorpus Monorepo
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.
Build your first search
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
- Build a typed model with the source generator.
- Run a complete application from the examples guide.
- Understand documents, commits, segments and readers in the architecture guide.
- Add metrics, tracing and slow-query logging through observability.
- Compare features and trade-offs in Why LeanCorpus?.
- Work on the repository using CONTRIBUTING.md.
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
LeanCorpus is licensed under the repository LICENCE.
| Product | Versions 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. |
-
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.