Hi Les,
I would also look at enabling full-text search on (I am assuming) SQL Server
and using the CONTAINS clause. You might still have to filter out the 'The',
but it might also help on other situations.

George



On 11/12/05, Adrian Lynch <[EMAIL PROTECTED]> wrote:
>
> If "The" is the only word causing you problems, look for it at the
> beginning
> of the search(it would have to be the beginning as you don't want to take
> it
> from the middle of a string) term and remove it before it gets passed to
> SQL.
>
> Ade
>
> -----Original Message-----
> From: Les Mizzell [mailto:[EMAIL PROTECTED]
> Sent: 11 November 2005 16:55
> To: CF-Talk
> Subject: Best Practice - Omit "The" and other common words Text Input
> for Search and another question
>
>
> Let's say I'm searching book titles in a database.
>
> I want to find "The Red Tent".
> However, in the database, it's listed as "Red Tent, The".
>
> So:
> search books
> where Title like '%#formtitle#%'
>
> So, the following will find it:
> "Red Tent"
> "Red"
> "Tent"
>
> The exact title "The Red Tent" won't.
>
> 1. What's the best way to exclude common words from what's entered in
> the form field.
>
> 2. How would I do something a little more comparitive?
> Assume the book title is actually "The Big Fat Tent that is Red"
> and if I enter "Red Tent" into the search field, I'd like
> it to come up.
>
> The only thing I can think of here would be to take each word entered
> into the form field - "The Red Tent" - put them in a list - "The, Red,
> Tent" - and then do a search for the terms in the list. Any other ideas?
>
> A verity search will NOT work in this case, as there's a ton of other
> tables with joins and all sorts of other rotten stuff involved...
>
> --
> -----------
> Les Mizzell
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224028
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to