PostgreSQL-specific dynamic search helpers for Entity Framework Core.
This package provides a focused API for building PostgreSQL-backed search filters over IQueryable<T> using expression-based property selectors for both full-text search and ILIKE pattern matching.
dotnet add package MatinDeWet.Searchable.PostgreSQL- Builds dynamic search predicates from a request object.
- Supports PostgreSQL full-text search via
tsvector+plainto_tsquery. - Supports
ILIKEmodes:Contains,StartsWith,EndsWith, andExact. - Escapes wildcard characters for safe
ILIKEusage. - Supports searching a single property or multiple properties with
OR/ANDlogic.
Use this when your entity has a mapped PostgreSQL tsvector property and you want to point directly to that property with an expression selector.
using NpgsqlTypes;
using Searchable.PostgreSQL;
using Searchable.PostgreSQL.Contracts;
IQueryable<Person> query = dbContext.People;
ISearchableRequest request = new SearchableRequest("john manager");
query = query.FullTextSearch(
request,
person => person.SearchVector,
language: "english");The selector expression is translated server-side, so you get the same simple property-targeting style as the single-property ILIKE API.
using Searchable.PostgreSQL;
using Searchable.PostgreSQL.Enums;
query = query.ILikeSearch(
request,
person => person.Email!,
ILikeMatchModeEnum.Contains);query = query.ILikeSearch(
request,
[person => person.FirstName!, person => person.LastName!, person => person.Email!],
ILikeMatchModeEnum.StartsWith,
useOrLogic: true);ILikeMatchModeEnum controls the generated PostgreSQL pattern:
Contains:%term%StartsWith:term%EndsWith:%termExact:term
Searchable.PostgreSQL.SearchableExtensionsSearchable.PostgreSQL.Contracts.ISearchableRequestSearchable.PostgreSQL.Enums.ILikeMatchModeEnum
The package uses the GPL-3.0-only license.