LunrCore 2.3.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package LunrCore --version 2.3.9                
NuGet\Install-Package LunrCore -Version 2.3.9                
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="LunrCore" Version="2.3.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LunrCore --version 2.3.9                
#r "nuget: LunrCore, 2.3.9"                
#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.
// Install LunrCore as a Cake Addin
#addin nuget:?package=LunrCore&version=2.3.9

// Install LunrCore as a Cake Tool
#tool nuget:?package=LunrCore&version=2.3.9                

lunr-core

A port of lunr.js to .NET Core. Lunr is a bit like Solr, but much smaller and not as bright.

.NET Core

TODO / up for grabs

  • Multilingual support (lunr has optional support that remains to be ported)
  • Documentation (adapted from lunr docs)

Example

A very simple search index can be created using the following:

var index = await Index.Build(async builder =>
{
    builder
        .AddField("title")
        .AddField("body");

    await builder.Add(new Document
    {
        { "title", "Twelfth-Night" },
        { "body", "If music be the food of love, play on: Give me excess of it…" },
        { "author", "William Shakespeare" },
        { "id", "1" },
    });
});

Then searching is as simple as:

await foreach (Result result in index.Search("love"))
{
    // do something with that result
}

This returns a list of matching documents with a score of how closely they match, the search query as well as any associated metadata about the match:

new List<Result>
{
    new Result(
        documentReference: "1",
        score: 0.3535533905932737,
        matchData: new MatchData(
            term: "love",
            field: "body"
        )
    )
}

Description

Lunr-core is a small, full-text search library for use in small applications. It indexes documents and provides a simple search interface for retrieving documents that best match text queries. It is 100% compatible with lunr.js, meaning that an index file prepared on the server with lunr-core can be used on the client using lunr.js.

Why

Lunr-core is suitable for small applications that require a simple search engine but without the overhead of a full-scale search engine such as Lucene. Its compatibility with lunr.js also opens up some interesting client-side search scenarios.

Features

  • Soon: Full text search support for 14 languages
  • Boost terms at query time or boost entire documents at index time
  • Scope searches to specific fields
  • Fuzzy term matching with wildcards or edit distance
  • No runtime dependencies beyond SDK, BCL AsyncInterfaces and System.Text.Json

Credits

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on LunrCore:

Package Downloads
Statiq.Lunr

Statiq is a configurable static content generation framework. This library provides support for creating search indexes.

LunrCoreLmdb

A .NET Core, LMDB-backed port of Oliver Nightingale's lunr.js library, a lightweight full-text indexing library that is "a bit like Solr, but much smaller and not as bright." Icon adapted from https://commons.wikimedia.org/wiki/File:Internal_Structure_of_the_Moon.JPG by Iqbal Mahmud under Creative Commons Attribution Share Alike 4.0 International

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on LunrCore:

Repository Stars
statiqdev/Statiq.Framework
A flexible and extensible static content generation framework for .NET.
Version Downloads Last updated
2.3.10 68,104 12/3/2021
2.3.9 95,862 6/2/2021
2.3.8.5 11,279 8/4/2020
2.3.8.4 871 7/30/2020
2.3.8.3 572 7/29/2020
2.3.8.2 602 7/27/2020
2.3.8.1 656 7/26/2020
2.3.8 592 7/26/2020