> ok right now i am doing this > <cfset dreamtext = REReplace(dream.dream,"([[:alpha:]])([^ > [:alpha:]])","\1 > \2","ALL")> > <cfset dreamtext = REReplace(dream.dream,"([^ > [:alpha:]])([[:alpha:]])","\1 > \2","ALL")>
> <CFQUERY datasource="#request.dsn#" name="dictionary"> > SELECT DISTINCT DJ_Dictionary.Word > FROM DJ_Dictionary > WHERE '#dreamtext#' LIKE '% ' + DJ_Dictionary.Word + ' %' > ORDER BY DJ_Dictionary.Word > </CFQUERY> > Works great and is very speedy. I implement the spaces > then just find the > words and the results come back very fast. HOWEVER how > would i add one more > where clause to pick up any word ending in S. > Meaning if the word bat is in the dream it will pick it > up, but if it's bats > it will not, and i want to pick up plurals. > I tried > OR '#dreamtext#' LIKE '% ' + DJ_Dictionary.Word[s] + ' %' > but that didn't work I am sure i Have the right idea just > the wrong format. > LOL Anyway ideas? > Kelly Well, the easy way is to just add 'bats' to your words table -- this also will help with plurals for which the trailing s doesn't necessarily apply, i.e. gooss, octopuss or mooses... ;P You could also add an or to your sql statement and another like, although for this sort of functionality you usually want to go with Verity indexing -- which will also improve your overall speed at the expense of forcing you to update your dictionary and your dreams catalog ( in Verity ) periodically and not getting "up to the second" results from the dream catalog when you perform these searches. If you don't want to get into the Verity stuff and you don't want to padd your dictionary, here's the other sql syntax SELECT DISTINCT DJ_Dictionary.Word FROM DJ_Dictionary WHERE '#dreamtext#' LIKE '% ' + DJ_Dictionary.Word + ' %' OR '#dreamtext#' LIKE '% ' + DJ_Dictionary.Word + 's %' ORDER BY DJ_Dictionary.Word hth s. isaac dealey 954-776-0046 new epoch http://www.turnkey.to lead architect, tapestry cms http://products.turnkey.to certified advanced coldfusion 5 developer http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm

