Chd.Library.ElasticSearch
8.7.0
dotnet add package Chd.Library.ElasticSearch --version 8.7.0
NuGet\Install-Package Chd.Library.ElasticSearch -Version 8.7.0
<PackageReference Include="Chd.Library.ElasticSearch" Version="8.7.0" />
<PackageVersion Include="Chd.Library.ElasticSearch" Version="8.7.0" />
<PackageReference Include="Chd.Library.ElasticSearch" />
paket add Chd.Library.ElasticSearch --version 8.7.0
#r "nuget: Chd.Library.ElasticSearch, 8.7.0"
#:package Chd.Library.ElasticSearch@8.7.0
#addin nuget:?package=Chd.Library.ElasticSearch&version=8.7.0
#tool nuget:?package=Chd.Library.ElasticSearch&version=8.7.0
Library.Common.Searching – Lightweight Full-Text Search & Indexing for .NET
Chd (Cleverly Handle Difficulty) library helps you cleverly handle difficulty, write code quickly, and keep your application stable.
📝 Table of Contents
- About
- Key Features
- Installation
- Usage
- API Reference
- Notes
- Comparison to Lucene.NET
- Authors
- Acknowledgements
About
Library.Common.Searching delivers Lucene-powered full-text search for any .NET project
via an ultra-simple, .NET-native API.
All complexity, configuration, and low-level boilerplate are abstracted away—focus on results.
Key Features
- Index and search any POCO class with zero config
- High-performance, typo/fuzzy-tolerant full-text search
- Local/disk-persistent, no server or database required
- Clean, developer-friendly API – just add, index, search
- Ideal for .NET 6–8 projects (console, server, desktop, tool)
Installation
dotnet add package Library.Common
Note:
Make sure your code usesusing Library.Common.Searching;as the namespace.
Usage
Basic Example
Copy and run: Minimal, real-world usage
using Library.Common.Searching;
using System;
using System.Collections.Generic;
namespace SearchDemo
{
class MyDoc
{
public string Title { get; set; }
public string Content { get; set; }
}
class Program
{
static void Main()
{
var indexer = new Indexer("C://Index");
indexer.WriteIndex(new List<MyDoc>
{
new MyDoc { Title = "What is Lucene?", Content = "Lucene is a high-performance text search engine library." },
new MyDoc { Title = "CHD Searching", Content = "Simple, .NET-native wrapper for Lucene search." }
}, deleteAll: true);
var results = indexer.Search<MyDoc>("lucene", x => x.Content);
foreach (var r in results)
Console.WriteLine($"{r.Title}: (score: {r.Score:0.00})");
}
}
}
Sample Output:
What is Lucene?: (score: 1.00)
CHD Searching: (score: 0.45)
Custom Property Search
Search by a different property or multiple fields
using Library.Common.Searching;
using System.Collections.Generic;
var indexer = new Indexer("C://Index");
indexer.WriteIndex(new List<SampleContainerClass>
{
new SampleContainerClass { S1 = "dotnet full text", S2 = "test tag" },
new SampleContainerClass { S1 = "another entry", S2 = "searchable data" }
}, deleteAll: true);
// Search on any property name(s)
var results = indexer.Search("test", "S2");
foreach (var dict in results)
Console.WriteLine($"{dict["S1"]} | {dict["S2"]}");
API Reference
Indexer(string path): Set location for index disk storage.void WriteIndex<T>(List<T> objects, bool deleteAll): Indexes objects; setdeleteAll: trueto refresh,falseto append.List<Dictionary<string,string>> Search(string query, params string[] fields): Search by explicit field name(s).List<T> Search<T>(string query, Func<T,string> propertySelector): Search by field selector, get strongly-typed results (with.Score).
Notes
- NuGet ve namespace kesinlikle Library.Common ve Library.Common.Searching
- Index is persisted on disk. Delete/replace with deleteAll param.
- Search results list top matches by Lucene-style relevance score.
- Works with any serializable C# class (POCO pattern).
Comparison to Lucene.NET
- Lucene.NET: Fast, flexible, but low-level and config-heavy.
- Library.Common.Searching:
- 100% Lucene power, 0% config/boilerplate.
- One NuGet, one using, one line to index/search.
- All analyzer/writer/reader/field schema logic is handled for you.
- If you want advanced custom analyzers or distributed clusters: use raw Lucene.NET.
- If you want code-first fast results in a .NET app: use this library!
✍️ Authors
- Mehmet Yoldaş - Linkedin
See also the list of contributors who participated in this project.
Acknowledgements
- Built with Lucene.NET as its core search engine.
- Thanks to open source contributors and Lucene.NET maintainers.
Feedback, feature requests and PRs welcome: mehmet-yoldas/library-core
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Lucene.Net (>= 4.8.0-beta00016)
- Lucene.Net.Analysis.Common (>= 4.8.0-beta00016)
- Lucene.Net.QueryParser (>= 4.8.0-beta00016)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.