Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about keyword search...

Status
Not open for further replies.

msscott

Programmer
Sep 12, 2001
8
US
Hello. I have a Cold Fusion page at that I need assistance with. Referring to the keyword search on that page, whatever you enter has to be an exact phrase. IOW, if you type, for example, &quot;chicken cow&quot;, it would look for that exact phrase and not return records that might contain &quot;chicken&quot; and &quot;cow&quot; (separately). I need it to have this capability. I am assuming that it is a problem with <CFQUERY>. It is as follows:

<CFQUERY NAME=&quot;REMEDYTABLE&quot;
DATASOURCE=&quot;remedykb&quot;>
SELECT *
FROM REMEDYTABLE
WHERE upper(PROBLEM) LIKE '%#ucase(PROBLEM)#%' OR upper(PROBLEM_SOLUTION) LIKE '%#ucase(PROBLEM)#%'
</CFQUERY>

Is there a modification I can make to this so that it will not be limited to returning exact phrases?

Thanks!
Shane
 
if in case you have
PROBLEM = &quot;chicken cow&quot;

and you want to search that as two different words than you have to treat that as two &quot;problems&quot;, e.g.

PROBLEM_1 = &quot;chicken&quot;
PROBLEM_2 = &quot;cow&quot;

and modify sql:

WHERE upper(PROBLEM) LIKE '%#ucase(PROBLEM_1)#%' OR upper(PROBLEM) LIKE '%#ucase(PROBLEM_2)#%' OR upper(PROBLEM_SOLUTION) LIKE '%#ucase(PROBLEM_1)#%' OR upper(PROBLEM_SOLUTION) LIKE '%#ucase(PROBLEM_2)#%' Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top