ColdFusion cfsearch special characters

172 Views Asked by At

I am currently using CF11 cfsearch on our website to retrieve products. However, if the product name has ANY special characters it generates an error.

We have products that have a hash, plus, exclamation signs and some with backslashes. How do I get cfsearch to search using these special symbols?

1

There are 1 best solutions below

0
On BEST ANSWER

I used something like this back in the day to solve <cfsearch> special character issues: https://cflib.org/udf/verityClean

You can start with dropping this in, and then tweak the regex if you continue to see issues with other special characters. It also depends if you are using Verity/Solr/etc. to know what characters will cause issues, so you may want to look into what characters cause issues for the engine/collection you are using.