Search code examples
c#linqfull-text-search

Linq and FullTextSearch - Asp.Net


I know Linq doesn't have a function that supports FullTextSearch, but my website (which uses Linq to SQL and Linq) needs to make use of FullTextSearch.

I feel I have two options to use FullTextSearch and Linq which are:

  1. Create a stored procedure in SQL server and query the SP via Linq
  2. Create a function in SQL server and use the function within a Linq statement

Does any one have any opinion as to what is better or is it a preference thing?


Solution

  • There is no full-text support within Linq-To-SQL. Creating a table-valued function and mapping it is your best option as the results can easily be included as part of a query, rather than the query itself. E.g. you could then restrict the query further, or apply an ORDER BY clause.