<p>Has anyone come up with a good way of performing full text searches (<code>FREETEXT() CONTAINS()</code>) for any number of arbitrary keywords using standard LinqToSql query syntax?</p>

<p>I'd obviously like to avoid having to use a Stored Proc or have to generate a Dynamic SQL calls.</p>

<p>Obviously I could just pump the search string in on a parameter to a SPROC that uses FREETEXT() or CONTAINS(), but I was hoping to be more creative with the search and build up queries like:</p>

<p>"pepperoni pizza" and burger, not "apple pie".</p>

<p>Crazy I know - but wouldn't it be neat to be able to do this directly from LinqToSql? Any tips on how to achieve this would be much appreciated.</p>

<p>Update: I think I may be on to something <a href="http://tomasp.net/blog/linq-expand-update.aspx" rel="nofollow noreferrer">here</a>...</p>

<p>Also: I rolled back the change made to my question title because it actually changed the meaning of what I was asking. I <em>know</em> that full text search is not supported in LinqToSql - I would have asked that question if I wanted to know that. Instead - I have updated my title to appease the edit-happy-trigger-fingered masses.</p>

[{'answer_id': 67738, 'author': 'Jon Limjap', 'author_id': 372, 'author_profile': 'https://Stackoverflow.com/users/372', 'pm_score': 3, 'selected': True, 'text': '<p>Unfortunately LINQ to SQL does not support Full Text Search. </p>\n\n<p>There are a bunch of products out there that I think could: Lucene.NET, NHibernate Search comes to mind. LINQ for NHibernate combined with NHibernate Search would probably give that functionality, but both are still way deep in beta.</p>\n'}, {'answer_id': 361690, 'author': 'LaserJesus', 'author_id': 45207, 'author_profile': 'https://Stackoverflow.com/users/45207', 'pm_score': 3, 'selected': False, 'text': "<p>I've manage to get around this by using a table valued function to encapsulate the full text search component, then referenced it within my LINQ expression maintaining the benefits of delayed execution:</p>\n\n<pre><code>string q = query.Query;\nIQueryable&lt;Story&gt; stories = ActiveStories\n                        .Join(tvf_SearchStories(q), o =&gt; o.StoryId, i =&gt; i.StoryId, (o,i) =&gt; o)\n                        .Where (s =&gt; (query.CategoryIds.Contains(s.CategoryId)) &amp;&amp;\n                                    /* time frame filter */\n                                (s.PostedOn &gt;= (query.Start ?? SqlDateTime.MinValue.Value)) &amp;&amp;\n                                (s.PostedOn &lt;= (query.End ?? SqlDateTime.MaxValue.Value)));\n</code></pre>\n\n<p>Here 'tvf_SearchStories' is the table valued function that internally uses full text search</p>\n"}]
['https://Stackoverflow.com/questions/67706', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1107/']