DynamicFullTextSearchService 1.0.1

dotnet add package DynamicFullTextSearchService --version 1.0.1                
NuGet\Install-Package DynamicFullTextSearchService -Version 1.0.1                
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="DynamicFullTextSearchService" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DynamicFullTextSearchService --version 1.0.1                
#r "nuget: DynamicFullTextSearchService, 1.0.1"                
#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.
// Install DynamicFullTextSearchService as a Cake Addin
#addin nuget:?package=DynamicFullTextSearchService&version=1.0.1

// Install DynamicFullTextSearchService as a Cake Tool
#tool nuget:?package=DynamicFullTextSearchService&version=1.0.1                

A library that provides dynamic Full Text Search and Regex support for PostgreSQL.

Step-1

Create the necessary property for the table you will use.

Important: Make sure the property name is the same as in the example.
public NpgsqlTsVector? search_vector { get; set; }

Step-2

The trigger automatically populates the search_vector column when adding or updating data to a table.

using (var context = new MyDbContext())
{
    var searchService = new DynamicFullTextSearchService<MyDbContext>(context);

    //Adds a Trigger to the table.
    //Trigger automatically populates the search_vector column when inserting or updating data in a table.
    await searchService.CreateTriggerForSearchVectorAsync(
        tableName: "YourTable", //The table name to which the trigger will be added.
        language: "Language", //The language to use in the search.
        columns: new[] { "Your Columns" } //Columns to use for search_vector.
    );
}

Step-3

Adds a GIN index for the search_vector column to the table. This improves search performance.

using (var context = new MyDbContext())
{
    var searchService = new DynamicFullTextSearchService<MyDbContext>(context);
    
    await searchService.CreateSearchVectorIndexAsync("YourTable");
}

You only need to use Step-2 and Step-3 once.

Step-4

After running Step-2 and Step-3 once, you are ready to use the Search method.

using (var context = new MyDbContext())
{
    var searchService = new DynamicFullTextSearchService<MyDbContext>(context);

    var results = searchService.DynamicSearch<MyEntity>(
        searchKeyword: "example",
        language: "english",
        x => x.Title,
        x => x.Description
    ).ToList();
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
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
1.0.1 54 1/14/2025
1.0.0 63 1/13/2025