Re: Little Help with a Site Search Query
On Sat, May 22, 2010 at 11:46 PM, Les Mizzell wrote: ... lst.srchTHS won't ever be more then three to five words or so, but I wish I could figure a way to use cfqueryparam list=yes instead of a loop... I think you might be able to concat the fields and then use a regex search, if the DB supports it, but the performance tradeoff might suck. Then there's stored procedures... you could offload the processing to the DB... :den -- It is not necessary that whilst I live I live happily; but it is necessary that so long as I live I should live honourably. Immanuel Kant ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333933 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Little Help with a Site Search Query
Hmmm - this will return NO results, though I know the terms I'm looking for exists: WHERE CAST(feature_text as VARCHAR) like cfqueryparam value=%#form.searchTERM#% cfsqltype=CF_SQL_VARCHAR / cfquery name=features SELECT id_feature, feature_headline, feature_date, year(feature_date) as theYEAR, CAST (feature_text AS VARCHAR ) FROM feature WHERE feature_headline in cfqueryparam value=#mylst# cfsqltype=CF_SQL_VARCHAR list=yes / cfloop list=#mylst# index=i OR CAST(feature_text as VARCHAR) like cfqueryparam value=%#i#% cfsqltype=CF_SQL_VARCHAR / /cfloop ORDER BY feature_date desc /cfquery __ Information from ESET NOD32 Antivirus, version of virus signature database 5138 (20100522) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333915 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Little Help with a Site Search Query
This ended up doing it: XOXO is always the last list item... cfquery name=features datasource=#req.data# username=#req.user# password=#req.pass# SELECT id_feature, feature_headline, feature_date, year(feature_date) as theYEAR, feature_text FROM feature WHERE cfloop list=#lst.srchTHS# index=i feature_headline like cfqueryparam value=%#i#% cfsqltype=CF_SQL_VARCHAR / OR feature_text like cfqueryparam value=%#i#% cfsqltype=CF_SQL_VARCHAR / cfif #i# eq XOXOcfelseOR/cfif /cfloop ORDER by feature_date DESC /cfquery ...unless anybody has a better idea... lst.srchTHS won't ever be more then three to five words or so, but I wish I could figure a way to use cfqueryparam list=yes instead of a loop... __ Information from ESET NOD32 Antivirus, version of virus signature database 5138 (20100522) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333928 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm