views:

4691

answers:

4

I wonder if is possible to use FTS with LINQ using .NET Framework 3.5. I'm searching around the documentation that I didn't find anything useful yet.

Does anyone have any experience on this?

+6  A: 

I don't believe so. You can use 'contains' on a field, but it only generates a LIKE query. If you want to use full text I would recommend using a stored proc to do the query then pass it back to LINQ

Glenn Slaven
+5  A: 

No, full text searching is something very specific to sql server (in which text is indexed by words, and queries hit this index versus traversing a character array). Linq does not support this, any .Contains() calls will hit the un-managed string functions but will not benefit from indexing.

+6  A: 

No. Full text search is not supported by LINQ.

That said, you can use a stored procedure that utilizes FTS and have the LINQ query pull data from that.

Gabriel Isenberg
+30  A: 

Yes in a way but you have to create SQL server function first and call that as by default LINQ will use a like.

See this blog post which will explain how.

John