C# – Looking for .NET software to abstract SQL Server’s Contains Syntax

cfull-text-searchnetsqlsql server

I am using SQL Server 2008 Full Text capabilities for the first time. I like the features that CONTAINS and CONTAINSTABLE offer, but I don't expect my users to learn the syntax for looking for inflections, using phrases, proximity, etc.

My GUI will have a single text box to search with. Is there anything (.net DLL or c# code) out there to convert the very common search engine operators to the CONTAINS syntax of SQL Server 2008? I don't have to use every feature of CONTAINS, just things like boolean operators, phrases, wildcards, exclusions, and possible inflections.

Best Answer

Have you considered simply using Lucene.net?

This involves additional effort at the sql server level, and does not support some of the complex queries than are possible with FTS but it will be providing just the sort of search your users are expecting.

This is recommended by quite a few people within stack overflow:

Ultimately you can try to push a non 'user centric' model into a user style mode or expend effort instead on adding an existing user centric search functionality.

I would suggest that if the following are true:

  • You have the hardware for the additional indexing requirements
  • You can handle the additional lag in the validity of the lucene.net index verses the FTS one.

Then you will have more success simply adding lucene.net