Copy link to clipboard
Copied
I need a way to search a particular field for "keywords" that may have been entered by a user in a search field.
Example: Keywords: phone,cable,contract OR Keywords: phone,cable OR Keywords: contract
I'm looking for a way to search for above keywords within lets say a Description field. The # of keywords entered is up to the user based on the types things they are looking for.
Any ideas?
Thanks in advance.
Brian
Copy link to clipboard
Copied
are you looking for an autocomplete function while using a search engine or to you want to search the posted form data on the server?
Copy link to clipboard
Copied
I just need to search a single field within a table. Something like:
select * from contract where the keywords entered are within the Description field
Copy link to clipboard
Copied
You need to be explain more. SELECT * FROM indicates that you want to do a SQL query?
e.g
SELECT * FROM dbo,xx
WHERE Description = 'keyword1' OR Description = 'keyword2' ...
Copy link to clipboard
Copied
select somefields
from sometables
where 1 = 2
<cfloop list="#keywords#" index = "word">
or somefield like '%#word#%'
</cfloop>