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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Search Structure

Status
Not open for further replies.

fiber0pti

ISP
Nov 22, 2000
96
US
I am wanting to search me CF site. I have multiple fields that I want people to be able to search. I also want people to be able to enter partial words. I am open to suggestions. I have created one but it doesn't work to well with mutliple partial words. The words have to be consecutive in my search engine. An example of something that I would want to do is let someone enter part of a part # and a word or 2 from the description (even if not complete words)
 
Verity is always a good choice although it doesn't work well with "partial" words.


Is your search currently making good use of the "LIKE" operator?


Your results may get a little weird, but consider this.
User enters his search criteria into a textbox called "UserSearchCriteria".

When you build your SQL treat that variable as a "space delimited list" and search for each "word" individually.

<cfquery>
Select Something from Somwhere
Where 1=1
<cfloop list=#UserSearchCriteria# index=index>
AND YourField LIKE '%#Index#%'
</cfloop>
</cfquery>


Good Luck :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top