Ferret.Core 0.1.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Ferret.Core --version 0.1.4
                    
NuGet\Install-Package Ferret.Core -Version 0.1.4
                    
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="Ferret.Core" Version="0.1.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ferret.Core" Version="0.1.4" />
                    
Directory.Packages.props
<PackageReference Include="Ferret.Core" />
                    
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 Ferret.Core --version 0.1.4
                    
#r "nuget: Ferret.Core, 0.1.4"
                    
#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 Ferret.Core@0.1.4
                    
#: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=Ferret.Core&version=0.1.4
                    
Install as a Cake Addin
#tool nuget:?package=Ferret.Core&version=0.1.4
                    
Install as a Cake Tool

Ferret

Postgres-first paging, filtering, sorting, and pluggable search for .NET. A drop-in alternative to Typesense / Meilisearch / Elastic for projects that already run PostgreSQL.

NuGet ci

Status: 0.1 — early pre-1.0. All backends are implemented and the core is exercised by a live origin project, but the library is not yet broadly battle-tested. The public API may change before 1.0.0. See VERSIONING.md for the pre-1.0 policy and road to 1.0.

Features

  • Pagination, filtering, sorting wired through a single query model.
  • Trigram fuzzy search (pg_trgm GiST), full-text (tsvector / GIN), and pgvector ANN (HNSW) — opt-in, mix-and-match.
  • Hybrid scoring (weighted RRF) across backends.
  • Configurable embeddings — OpenAI-compatible, Ollama, or any Microsoft.Extensions.AI generator.
  • Schema is generated for you from [Searchable] attributes via EF Core migrations (Ferret.Migrations) — or hand-roll it if you prefer.
  • ORM-agnostic. EF Core or Dapper adapters ship in the box; bring your own session for any other stack.
  • Attribute-driven entity discovery; pluggable naming strategy (snake_case / identity).
  • ASP.NET Core model binders + one-line MapFerret endpoints with OpenAPI.

Packages

Package Purpose
Ferret.Abstractions Interfaces, attributes, query/result models. Reference from your domain assemblies.
Ferret.Core Engine, SQL builder, attribute discovery, Postgres dialect, search backends.
Ferret.Migrations EF Core migrations bridge — generates trigram/full-text/vector schema from annotations.
Ferret.EntityFrameworkCore EF Core session + hydrator + search extensions.
Ferret.Hydration.Dapper Dapper-based session + hydrator for EF-free use.
Ferret.AspNetCore OffsetApiQuery / CursorApiQuery + binders + MapFerret.
Ferret.Hosting Reindex BackgroundService (drains ferret_reindex_jobs).
Ferret.Tools.Cli dotnet ferret reindex CLI tool.
Ferret.Compat.LegacyApi Wire-shape adapter for clients using the original PagedQuery JSON shape.

Install

dotnet add package Ferret.Core
dotnet add package Ferret.EntityFrameworkCore   # or: Ferret.Hydration.Dapper

Quickstart — EF Core

Annotate the entity:

using Ferret.Abstractions;

[SearchableEntity]
public sealed class Product : ISearchableEntity<Guid>
{
    public Guid Id { get; init; }

    [Searchable, Filterable, Sortable]
    public string Name { get; init; } = "";

    [Searchable(Weight = 2.0f)]
    public string Sku { get; init; } = "";
}

Wire up DI:

services.AddDbContext<AppDbContext>(o => o.UseNpgsql(connectionString));
services.AddFerret(opts => opts
    .ScanAssembly(typeof(Product).Assembly)
    .UseTrigramSearch());

Generate the schema (Ferret.Migrations — see docs/migrations.md), then search:

var page = await dbContext.SearchOffsetAsync<Product, Guid>(serviceProvider,
    new PagedQuery<Product, Guid>
    {
        Mode = PaginationMode.Offset,
        Search = "blue widge",
        Limit = 25,
        Page = 0,
        Sort = [new SortClause { Field = "Name", Direction = SortDirection.Ascending }],
    });

Cursor mode is available via dbContext.SearchCursorAsync<...> returning CursorResult<T>.

Quickstart — Dapper

services.AddFerret(opts => opts
    .ScanAssembly(typeof(Product).Assembly)
    .UseTrigramSearch()
    .UseDapperHydration());

await using var session = new DapperSession(
    ct => Task.FromResult<DbConnection>(new NpgsqlConnection(connectionString)),
    sp.GetRequiredService<ISqlDialect>());

var page = await sp.GetRequiredService<IFerretEngine>()
    .SearchOffsetAsync<Product, Guid>(session,
        new PagedQuery<Product, Guid> { Mode = PaginationMode.Offset, Search = "widge", Limit = 25 });

Documentation

Compatibility

  • .NET 10 SDK
  • EF Core 10 (when using Ferret.EntityFrameworkCore / Ferret.Migrations)
  • PostgreSQL 15, 16, 17 — CI matrix runs all three
  • Extensions: trigram needs pg_trgm; full-text needs none; vector needs vector (pgvector)
  • Ferret.Migrations builds on EntityFrameworkCore.ExtensibleMigrations (source)

License

MIT.

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

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Ferret.Core:

Package Downloads
Ferret.Hydration.Dapper

Dapper-based IEntityHydrator + IFerretSession adapter for standalone Ferret use.

Ferret.EntityFrameworkCore

EF Core hydrator and session adapter for Ferret. Brings the full LINQ escape-hatch.

Ferret.Hosting

Background reindex worker hosting for Ferret: drains full-text reindex jobs on a poll loop.

Ferret.Migrations

EF Core migrations bridge for Ferret — auto-generates trigram (pg_trgm GiST), full-text (tsvector/GIN), and pgvector (HNSW) schema from [Searchable] annotations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.7 123 8/22/2026
0.1.6 119 8/21/2026
0.1.5 147 7/27/2026
0.1.4 241 7/19/2026
0.1.3 148 7/18/2026
0.1.2 141 7/18/2026
0.1.0 163 6/25/2026