[thelist] [CFMX] How to implement a search feature?

Judah McAuley judah at wiredotter.com
Thu Jun 19 11:02:45 CDT 2003


Chris Johnston wrote:
> 1. Is there something like the java string tokenizer in CF? A simple way
> to take a string and split it into different words.

You can treat it as a space delimited list.  So if the search was for 
"foo bar baa" you could use ListLen(thelist, " ") to get the fact there 
are 3 words and you could use ListGetAt(thelist, 1, " ") to get the 
first search term.

> 2. I know in sql you can do a search using like and the wildcard
> character. Is there a way of doing this with a list.
> 
> i.e. select * from foo where col in ('%word1%', '%word2%', etc...)
> 
> and have it act in the same manner as using like?

Not that I know of.  You'd be better off though using full text search 
anyway.  Full text search is available in MS SQL and Sybase ASE I know 
and I think its available in MySQL and PostGres now.  Its really build 
for what you want to do.  If you tell us your DB we can probably provide 
some pointers to resources.

Judah




More information about the thelist mailing list