Chd.Library.ElasticSearch 8.5.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package Chd.Library.ElasticSearch --version 8.5.6
                    
NuGet\Install-Package Chd.Library.ElasticSearch -Version 8.5.6
                    
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="Chd.Library.ElasticSearch" Version="8.5.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Chd.Library.ElasticSearch" Version="8.5.6" />
                    
Directory.Packages.props
<PackageReference Include="Chd.Library.ElasticSearch" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Chd.Library.ElasticSearch --version 8.5.6
                    
#r "nuget: Chd.Library.ElasticSearch, 8.5.6"
                    
#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.
#:package Chd.Library.ElasticSearch@8.5.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Chd.Library.ElasticSearch&version=8.5.6
                    
Install as a Cake Addin
#tool nuget:?package=Chd.Library.ElasticSearch&version=8.5.6
                    
Install as a Cake Tool

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. NuGet License


📝 Table of Contents


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 Libary.Common

Note:
Make sure your code uses using Libary.Common.Searching; as the namespace.


Usage

Basic Example

Copy and run: Minimal, real-world usage

using Libary.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)

Search by a different property or multiple fields

using Libary.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; set deleteAll: true to refresh, false to 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 Libary.Common ve Libary.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

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.7.0 79 3/5/2026
8.5.6 88 2/19/2026
8.5.5 167 1/20/2026
8.5.4 120 1/15/2026
8.5.3 125 1/12/2026
8.5.2 171 7/31/2025
8.5.1 601 7/23/2025
8.0.8 188 12/23/2024
Loading failed