3

There are 4 functions provided in SQL Server 2008 for full-text search: CONTAINS, CONTAINSTABLE, FREETEXT, FREETEXTTABLE

How to use it them with Linq ?

KentZhou
  • 24,805
  • 41
  • 134
  • 200

3 Answers3

2

You cannot translate a linq query into full-text search functions, there is no direct support for this.

However, there are some workarounds - see http://sqlblogcasts.com/blogs/simons/archive/2008/12/18/LINQ-to-SQL---Enabling-Fulltext-searching.aspx for an indirect method of using full-text search.

womp
  • 115,835
  • 26
  • 236
  • 269
1

See stackoverflow post "Is it possible to use Full Text Search (FTS) with LINQ?" which provides a link to the blog post "Linq to SQL - Enabling Fulltext Search"

Community
  • 1
  • 1
Cory
  • 12,404
  • 7
  • 33
  • 28
0

As far as I know, there's no built-in support for those functions in LINQ - you'll need to formulate your T-SQL query and then use the Linq's DataContext.ExecuteQuery() call to send that T-SQL directly to SQL Server.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459