I am building a C#/ASP.NET app with an SQL backend. I am on deadline and finishing up my pages, out of left field one of my designers incorporated a full text search on one of my pages. My ‘searches’ up until this point have been filters, being able to narrow a result set by certain factors and column values.
Being that I’m on deadline (you know 3 hours sleep a night, at the point where I am looking like something the cat ate and threw up), I was expecting this page to be very similar to be others and I’m trying to decide whether or not to make a stink. I have never done a full text search on a page before…. is this a mountain to climb or is there a simple solution?
thank you.
First off, you need to enabled Full text Searching indexing on the production servers, so if thats not in scope, your not going to want to go with this.
However, if that’s already ready to go, full text searching is relatively simple.
T-SQL has 4 predicates used for full text search:
FREETEXT is the simplest, and can be done like this:
FREETEXTTABLE works the same as FreeTEXT, except it returns the results as a table.
The real power of T-SQL’s full text search comes from the CONTAINS (and CONTAINSTABLE) predicate…This one is huge, so I’ll just paste its usage in:
This means you can write queries such as:
Good luck 🙂