全文索引+ CodeFirst [英] Full-Text Indexing + CodeFirst

查看:103
本文介绍了全文索引+ CodeFirst的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

是否有关于如何使用EF CodeFirst设置全文索引的指导? 我希望在我的模型中搜索特定属性中的某些关键字。 (string.Contains不再削减它了。)

Is there any guidance on how to setup full-text indexing with EF CodeFirst?  I'm looking to search my model for certain keywords from particular properties. (string.Contains isn't cutting it anymore).

谢谢!

Michael

推荐答案

嗨Michael,

Hi Michael,

EF还不支持全文搜索,最简单的方法是使用DbSet.SqlQuery来运行存储利用全文搜索的查询。

EF doesn't support full text search yet, the easiest way around this is to use DbSet.SqlQuery to run a store query that takes advantage of full text search.

如果您使用Code First生成数据库,则需要运行其他DDL来添加索引,如下所示;  http://romiller.com/2010/07/31/ef-ctp4-tips-tricks-running-additional-ddl/

If you are using Code First to generate the database then you will need to run additional DDL to add the index, something like this; http://romiller.com/2010/07/31/ef-ctp4-tips-tricks-running-additional-ddl/

~Rowan


这篇关于全文索引+ CodeFirst的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆