为什么我不能使用 postgresql 将 IsTsVectorExpressionIndex 添加到 EF CORE 的模块构建器?
Why cant I add IsTsVectorExpressionIndex to modulebuilder for EF CORE using postgresql?
我正在尝试使用 NPGSQL 网站上的说明在 .net core 3-web 应用程序中设置全文搜索 https://www.npgsql.org/efcore/mapping/full-text-search.html?tabs=pg12
在OnModelCreating-method中我是按照规范设置的:
modelBuilder.Entity<Clinic>()
.HasIndex(p => new { p.Name, p.SlugUrl })
.IsTsVectorExpressionIndex("english");
但是得到的错误是 IndexBuilder' 不包含 'IsTsVectorExpressionIndex' 的定义。
我尝试添加了一堆 nuget-packages,但它们似乎没有解决问题。在没有 TSVector 的情况下创建索引工作正常。
知道我哪里做错了吗?下载的包:
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0" />
<PackageReference Include="Npgsql" Version="4.1.6" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.8" />
IsTsVectorExpressionIndex
仅在提供程序的 5.0.0 版本中引入,该版本刚刚在几个小时前发布。
我正在尝试使用 NPGSQL 网站上的说明在 .net core 3-web 应用程序中设置全文搜索 https://www.npgsql.org/efcore/mapping/full-text-search.html?tabs=pg12
在OnModelCreating-method中我是按照规范设置的:
modelBuilder.Entity<Clinic>()
.HasIndex(p => new { p.Name, p.SlugUrl })
.IsTsVectorExpressionIndex("english");
但是得到的错误是 IndexBuilder' 不包含 'IsTsVectorExpressionIndex' 的定义。
我尝试添加了一堆 nuget-packages,但它们似乎没有解决问题。在没有 TSVector 的情况下创建索引工作正常。
知道我哪里做错了吗?下载的包:
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0" />
<PackageReference Include="Npgsql" Version="4.1.6" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.8" />
IsTsVectorExpressionIndex
仅在提供程序的 5.0.0 版本中引入,该版本刚刚在几个小时前发布。