>- see footer for list info -< It's the wrong way round. You can't have CF act on column data until it's returned. Your REReplaceNoCase() is looking for a variable a.model_name, you didn't say you got a CF error but I'm guessing you did.
I'm not sure if this will give you the results you're after but you should use the REReplaceNoCase on the keyword: CONTAINS(#REReplaceNoCase(a.model_name, '#REReplaceNoCase(ii, "REGEX HERE", " ", "ALL")#') Also, if you're not happy with the FTS, store keywords in the DB and get the client to add them. If they want MX-5 to match for MX5 then they can add it themselves. Ade -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Hooman Behnia Sent: 11 November 2005 12:59 To: 'Coldfusion Development' Subject: RE: [CF-Dev] Using T-SQL with Full Text Searching >- see footer for list info -< I can't get that to work. I am doing: CONTAINS(#reReplaceNoCase(a.model_name, "[^a-z\s]", " ", "ALL")#), '#ii#') where a.model_name is the db column I am searching and #ii# is the keyword. What am I doing wrong? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Simon Baynes Sent: 11 November 2005 12:44 To: Coldfusion Development Subject: Re: [CF-Dev] Using T-SQL with Full Text Searching >- see footer for list info -< Why don't you use regEx in CF to do it for you? ie CONTAINS(#reReplaceNoCase(keyword, "[^a-z\s]", " ", "ALL")#) On 11/11/05, Hooman Behnia <[EMAIL PROTECTED]> wrote: > >- see footer for list info -< > Hi all, > > > > I hope someone can help me with this problem as otherwise I will be reduced > to ghastly hacks! > > > > I am adding a full text search facility to a client website that deals in > cars. They want to be able to do keyword searches on their cars, but they > want it to return results even when the keyword is not typed in exactly > right, e.g. if they search for mx5, they want Mazda MX-5 to be returned, > despite the lack of the "-" in the keyword. > > > > I have tried the various fuzzy search options such as SOUNDEX and > DIFFERENCE, but they don't work in all instances and when they do, the > resultset is too big and too vague. > > > > Hence, I am trying to stick with a simple CONTAINS() statement, but I want > to remove all dashes and spaces from the data in the column I am searching > before doing the CONTAINS() on it. > > > > I have tried something like this: > > > > SELECT make_name, model_name, derivative_name.... > > FROM cars > > WHERE CONTAINS(replace(model_name, '-', ''), 'keyword') > > > > However, it does not seem to work. I think it doesn't like the fact that I > am using tsql inside a CONTAINS() statement. > > > > Anyone got any ideas? Can what I am trying to do work, and I'm just doing it > wrong? > > > > Thanks for any help. _______________________________________________ For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo -- CFDeveloper Sponsors:- >- Hosting provided by www.cfmxhosting.co.uk -< >- Forum provided by www.fusetalk.com -< >- DHTML Menus provided by www.APYCOM.com -< >- Lists hosted by www.Gradwell.com -< >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
