PGroonga.EntityFrameworkCore
3.1.0
تمديد pgroonga لـ npgsql.entityframeworkcore.postgresql (PostgreSQL / NPGSQL Entity Framework Core). إنه يمكّن القدرة على إجراء البحث عن النص الكامل ، وخاصة الصينية واليابانية وما إلى ذلك ، مع Coreframework Core ، PostgreSQL و Groonga.


EF.Functions.Pgroonga* يعمل فقط مع Npgsql.EntityFrameworkCore.PostgreSQL > = 2.2.6 و> = 3.0.1 بسبب AspNet/entityframeworkcore#13454.
public class ApplicationDbContext : DbContext
{
// ...
protected override void OnModelCreating ( ModelBuilder modelBuilder )
{
base . OnModelCreating ( modelBuilder ) ;
// ...
modelBuilder . Entity < Post > ( )
. HasIndex ( g => g . Content )
. HasMethod ( "pgroonga" )
. HasOperators ( "pgroonga_varchar_full_text_search_ops_v2" ) ;
}
}
public class Startup
{
// ...
public void ConfigureServices ( IServiceCollection services )
{
services . AddDbContextPool < ApplicationDbContext > ( options =>
options . UseNpgsql ( Configuration . GetConnectionString ( "DefaultConnection" ) ,
builder => builder . UsePGroonga ( ) ) ) ;
// ...
}
}
var posts = await _dbContext . Posts . Where ( g => g . Content . SimilarSearch ( q ) )
. OrderByDescending ( g => EF . Functions . PgroongaScore ( ) )
. ToArrayAsync ( ) ; لمزيد من المعلومات ، راجع PGroongaLinqExtensions و PGroongaDbFunctionsExtensions .
LIKELIKE ILIKEILIKE &@ مباراة &@~ استعلام &@* مماثلة للبحث &` scriptquery &@| متطابق &@~| Queryin &^ prepixSearch &^~ profixrksearch &^| precixSearchin &^~| profixrksearchin &~ regexpmatch pgroonga_commandpgroonga_command_escape_valuepgroonga_escapepgroonga_flushpgroonga_highlight_htmlpgroonga_is_writablepgroonga_match_positions_bytepgroonga_match_positions_characterpgroonga_normalizepgroonga_query_escapepgroonga_query_expandpgroonga_query_extract_keywordspgroonga_set_writablepgroonga_scorepgroonga_snippet_htmlpgroonga_table_namepgroonga_wal_applypgroonga_wal_truncateترخيص معهد ماساتشوستس للتكنولوجيا
مزيد من المعلومات انظر الترخيص