I have an existing website developped using ASP.NET MVC 3 and Entity Framework 4 querying an Sql Server 2008 database. It contains a search form with around 10 fields, and when the user clicks the submit button I dynamically create an Entity SQL request containing only the specified search fields, omitting the empty ones. It works. So far so good.
Now, the client wants a Full Text Search behavior for one of the fields. I see this request as being pretty complex because (AFAIK) :
- Entity Framework does not natively supports full text search
- I want to avoid stored procedures to wrap the FTS syntax because so far I've only used "static" SPs, keeping the logic in the .NET code. So I want to try to avoid building the query inside the procedure. And creating one procedure per possible search field combination is not an option.
Solutions I could think of so far :
- Putting a stored procedure or user defined function as a seach preadicate in the WHERE clause (i'm not sure that's possible though)
- Getting the FTS results alone in a temporary table, and execute the other filters on that temporary table. I'm afraid of poor performances if there are a lot of FTS results with this technique...
What's the best way for daeling with this ?