I have an Oracle query that I'm trying to get it to work like a google search. I have a list of words that it can contain (search_ar) and a list of words that it must contain (search_must) designated by a +. It will also have a MUST NOT CONTAIN, which will be designated by a -. So when I do the search "research analysis", it gives me 49 hits. When I do "research analysis +taag", it gives me the same 49, even though I know that only 2 of the 49 have the word taag in it. I figured that it would give me 2 hits and that this is a bracketing issue for the query and I suppose it might still be, but I don't see it. How would I write the query to do what I think is correct. Also, that's how it should work right (if it were google-like)?
WHERE <cfloop from="1" to="#arrayLen(search_ar)#" index="ii"> UPPER(#PreserveSingleQuotes(the_search_column)#) LIKE UPPER('%#search_ar[ii]#%') <cfif ii LT arrayLen(search_ar)>OR</cfif> </cfloop> <cfif arrayLen(search_ar) GT 0 AND arrayLen(search_must) GT 0>AND</cfif> <cfif arrayLen(search_must) GT 0> ( <cfloop from="1" to="#arrayLen(search_must)#" index="jj"> UPPER(#PreserveSingleQuotes(the_search_column)#) LIKE UPPER('%#search_must[jj]#%') <cfif jj LT arrayLen(search_must)>AND</cfif> </cfloop> ) </cfif> thanks! -- Daniel Kessler Department of Public and Community Health University of Maryland Suite 2387 Valley Drive College Park, MD 20742-2611 301-405-2545 Phone www.phi.umd.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219628 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54