Ferret.Abstractions 0.1.7

dotnet add package Ferret.Abstractions --version 0.1.7
                    
NuGet\Install-Package Ferret.Abstractions -Version 0.1.7
                    
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.Abstractions" Version="0.1.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ferret.Abstractions" Version="0.1.7" />
                    
Directory.Packages.props
<PackageReference Include="Ferret.Abstractions" />
                    
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.Abstractions --version 0.1.7
                    
#r "nuget: Ferret.Abstractions, 0.1.7"
                    
#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.Abstractions@0.1.7
                    
#: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.Abstractions&version=0.1.7
                    
Install as a Cake Addin
#tool nuget:?package=Ferret.Abstractions&version=0.1.7
                    
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.

Choosing a backend

Backend Best for
Trigram (pg_trgm) Typo-tolerant fuzzy matching on short fields — names, codes, SKUs.
Full-text (tsvector) Language-aware relevance ranking over longer prose.
Vector (pgvector) Semantic similarity via embeddings — "find things like this," not just matching words.
Hybrid Full-text and vector fused with weighted RRF, for lexical + semantic recall together.

Trigram and full-text can run standalone or side by side; vector and hybrid add embeddings on top. See Full-text search, Vector search & embeddings, and Vector filtering for setup and trade-offs.

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 + DI registration.
Ferret.Hydration.Dapper Dapper query service, 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.

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());
services.AddFerretEntityFrameworkCore<AppDbContext>();

Generate the schema (Ferret.Migrations — see docs/migrations.md), then inject IFerretQueryService (Ferret.Abstractions.Querying) and search:

public sealed class ProductsController(IFerretQueryService search) : ControllerBase
{
    [HttpGet]
    public Task<OffsetResult<Product>> Get(CancellationToken ct) =>
        search.SearchOffsetAsync<Product, Guid>(new PagedQuery<Product, Guid>
        {
            Mode = PaginationMode.Offset,
            Search = "blue widge",
            Limit = 25,
            Page = 0,
            Sort = [new SortClause { Field = "Name", Direction = SortDirection.Ascending }],
        }, ct);
}

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

Quickstart — Dapper

services.AddNpgsqlDataSource(connectionString);

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

services.AddFerretDapper();

Then inject the same IFerretQueryService the EF quickstart uses — application code is identical either way:

public sealed class ProductsController(IFerretQueryService search) : ControllerBase
{
    [HttpGet]
    public Task<OffsetResult<Product>> Get(CancellationToken ct) =>
        search.SearchOffsetAsync<Product, Guid>(
            new PagedQuery<Product, Guid> { Search = "widge", Limit = 25 }, ct);
}

See docs/advanced.md for custom connection factories and the lower-level IFerretEngine / session APIs.

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.
  • net10.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Ferret.Abstractions:

Package Downloads
Ferret.Core

Postgres-first paging, filtering, sorting, and pluggable search engine for .NET.

Ferret.AspNetCore

ASP.NET Core integration for Ferret: query model + binders + IServiceCollection helpers.

Ferret.Hosting

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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.7 152 8/22/2026
0.1.6 150 8/21/2026
0.1.5 177 7/27/2026
0.1.4 271 7/19/2026
0.1.3 169 7/18/2026
0.1.2 172 7/18/2026
0.1.0 195 6/25/2026