Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfsearch 1

Status
Not open for further replies.

BKP1

Programmer
Jan 19, 2007
8
US
I have a problem with cfsearch results.
If my criteria includes characters other than alphanumerals then cfsearch returns 0 records.
What should I do to include other characters such as -, ., !, ?, etc. in the search.
I would appreciate any help.

Thanks!
 
I think that we had this problem a while ago, and used a regex to remove these characters from the search, as they re effectively "noise" characters.

have a look at this article:

what you will need is something like this:

<cfset searchString = ReReplace(Form.SearchCriteria, [:punct:], '', 'All')>

Hope this helps!

Tony
 
Thanks!. I tried that.
<cfset searchString = ReReplace(FORM.keywords, [:punct:], '', 'All')>
But I get the following error.

"Missing argument name. When using named parameters to a function, every parameter must have a name."


I am not sure what's wrong.
 
sorry, my bad..the reg ex needs to be in quotes

<cfset searchString = ReReplace(Form.SearchCriteria, "[:punct:]", '', 'All')>

Tony
 
Thank you so much. It's working!
Have a nice day!

Pushpa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top