PC Review


Reply
Thread Tools Rate Thread

C# Full Text Search Box Criteria Parsing

 
 
Larry Neylon
Guest
Posts: n/a
 
      5th Mar 2007
Hi there,

Has anyone written the code to take a user text box containing full text
search criteria and convert it into the string that you can pass to SQL
Server's CONTAINSTEXT command ?

What I think it needs to do is check for multiple words. If there are
multiple words surround with double quotes, unless there are already some
double quotes in there. It also needs to handle whether AND and ORs have
been entered before deciding whether to surround the whole thing with double
quotes.

So I have to convert:

Chairman -> Chairman
Temporary Chairman -> "Temporary Chairman"
Temporary AND Chairman -> Temporary AND Chairman
Temporary AND New Chairman -> Temporary AND "New Chairman"
Temporary AND "New Chairman" -> Temporary AND "New Chairman"
Temporary AND "New Chairman -> Temporary AND "New Chairman" (i.e. cater for
missed or extra quotes)

I'm sure using regular expressions this shouldn't actually be that hard, and
I can't believe I'm the first person to want to do this.

Any assistance much appreciated.

Thanks,
Larry.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Help parsing HTML into text in my text box within my form KARL DEWEY Microsoft Access Forms 1 30th Mar 2010 04:00 PM
Parsing HTML in .Net (Document Object Model Parsing) Jarod_24 Microsoft VB .NET 0 4th Apr 2006 06:23 PM
Options for generic full-text search without using database-specific full-text engine? Samuel R. Neff Microsoft ASP .NET 2 10th Jun 2005 07:53 PM
Options for generic full-text search without using database-specific full-text engine? Samuel R. Neff Microsoft C# .NET 2 10th Jun 2005 07:53 PM
Parsing out text entries in a text box jasonsweeney Microsoft Excel Programming 17 9th Feb 2004 06:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:07 AM.