I hope your database isn't large. This '%string%' can be slower than a teenager doing the dishes if your search set is large. I found that anything over 100,000 records got too slow for me, but I couldn't tell you what hardware I was running under at the time.
On 7/25/02 4:40 PM, "Benoit Martin" <[EMAIL PROTECTED]> wrote: > <cfset WhereClause = WhereClause & " and Title like '%" & form.titleValue & > "%'"> > > > -----Original Message----- > From: Doherty,Sean [NCR] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 1:04 PM > To: CF-Talk > Subject: coldfusion search > > > Hi ... i am a newbie to CF ... I was wondering if some one could help me > figure out how to make a search box that can do a "contains" search ... i > can get the begins with and the equals, but not contains ... see below > thanks! > > <cfset WhereClause = "0=0"> > <cfif Form.titleValue GT ""> > <cfif Form.titleOperator EQ "EQUALS"> > <cfset WhereClause = WhereClause & "and Title ='" & > form.titleValue & "'"> > </cfif> > <cfif Form.titleOperator EQ "BEGINS_WITH"> > <cfset WhereClause = WhereClause & " and Title like '" & > form.titleValue & "%'"> > <cfelse> > <cfset WhereClause = WhereClause & " and Title like '" & > form.titleValue & WHAT DO I PUT HERE TO MAKE CONTAINS > WORK?> > </cfif> > </cfif> > > ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

