我正在尝试使用NPGSQL网站https://www.npgsql.org/efcore/mapping/full-text-search.html?tabs=pg12上的说明在.net core 3-web应用程序中设置全文搜索
在OnModelCreating方法中,我根据规范进行了设置:
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版本中引入,该版本是几个小时前发布的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句