A .NET-native full-text search engine. Segment-centric indexing, memory-mapped reads, and atomic commit semantics. Targets net10.0 and net11.0. The core library has no external dependencies; stored-field compression uses BCL types only. Optional extension packages add LZ4, Snappy, and Zstandard support.
Inspired by Apache Lucene.
All projects target .NET 10, and .NET 11. Versions < 10 are not supported. (LeanCorpus.SourceGen is a .NET Standard library, for obvious reasons though).
Typed mapping source generator
Zstandard stored field compression
LZ4 stored field compression
Snappy stored field compression
Rowles.LeanCorpus is marked AOT-compatible for net10.0 and net11.0. The core library avoids reflection-based JSON metadata and is validated by a dedicated xUnit smoke executable (which can be ran with .\scripts\aot-smoke.ps1) rather than the ASP.NET JSON API example.
This publishes src\examples\Rowles.LeanCorpus.Example.NativeAot\Rowles.LeanCorpus.Example.NativeAot.csproj for win-x64 with PublishAot=true, then runs the native executable. The smoke executable several different bits of the library that may have proved some difficulty.
A note if you're using on of the optional compression libraries, and are using native AOT:
The core library has no native sidecar dependencies for compression. Optional packages (Rowles.LeanCorpus.Compression.LZ4, Rowles.LeanCorpus.Compression.Snappy, Rowles.LeanCorpus.Compression.Zstandard) may include RID-specific native binaries; AOT consumers using those packages must call their respective Register() methods at startup.
Important
While LeanLucene is AOT capable, it does not support (and does not intend to support) Blazor WASM. LeanLucene (and the other segment-centric engines) require use of the OS's filesystem to achieve its performance. It would be too much work (and a project itself) to support a dual approach with a filesystem, and the browsers limited storage.
Blazor Server/Hybrid remains supported (naturally), as long as the indexing happens server-side.