Skip to main content
Inspiring
June 10, 2008
Question

Searching for keywords

  • June 10, 2008
  • 2 replies
  • 515 views
Hi everyone,
I was wondering if there was a way I could find some text that is separated by a word in the middle? For example, if I search for GHz Socket on our web site, our part numbers don’t show up because the column this search is querying off of has, “GHz BGA Socket” in it. Is there a way so that the user does not have to type the exact thing or groups of words together all together when they type the words in? I would like it so they don’t have to type BGA in order to see these parts. I’m trying to use the % signs which I thought you could type anything anywhere and still come up with results since it would have some of thee words in the search. The way I have the code right now is like this:



<cfif PartNumber NEQ "*">

<cfset session.BrowsePartGridWhere = "Part_Description LIKE '%#PartNumber#%'">

</cfif>

Thanks.

Andy Text
This topic has been closed for replies.

2 replies

Inspiring
June 11, 2008
this is slow but it works

where (
lower(yourfield) like '%#lcase(word1)#%'
or
lower(yourfield) like '%#lcase(word2)#%'
etc

)
Participating Frequently
June 10, 2008
Try searching for GHz%Socket if Part_Description LIKE '%#PartNumber#%'

Phil
Inspiring
June 10, 2008
This only works if the user actually types in "ghz%socket" into the search form. They're not going to know to do that though. I would like to write this into the code somehow to catch things like this. Do you have any other ideas? Thanks.

Andy