Mutli-Word search for best result

Have you even wanted to search for multiple words in a search (but as separate elements)? If a user typed in:

"ColdFusion MX Tutorials"

in a search box, this tutorial will show you how to accuretly return results from your data, where each individual word is filtered from the data...

<CFQUERY NAME="searchresults" DATASOURCE="yourdatasource">
    SELECT *
    FROM table
    WHERE 0=0
    AND

(
<cfloop index="i" list="#form.searchkeyword#" delimiters=" ">
    <cfoutput>
fieldname LIKE '%#i#%' AND </cfoutput>
</cfloop>
'%%')

</CFQUERY>

it is so simple ......

All ColdFusion Tutorials By Author: Ayhan
  • Mutli-Word search for best result
    We think that we have the right search function! But we don't have. Lets see I what I am trying to say. For example: You are trying to find a tutorial about javascript validation. when you search "javascript validation" results comes "0". But they have tutorial about validation and they stored it as "JavaScript Form Validation". If you want to see it at search result page you must write in order as it is in database or indexes.. let's see how we can get correct search results.
    Author: Ayhan
    Views: 15,603
    Posted Date: Monday, April 5, 2004
  • get fedex rates from your server
    If have online store or you are planning to have one; then you must give estimate or real number of shipping charge(I am only talking about FedEx). There are few ways to do this. Like using FedEx ship API writing some script(or using XML injection ) to request rates from FedEx servers. But there is big handicap; FedEx shipAPI is slowing down your application and sometimes their servers are down. Which all doesnt sound good for e-commerce business. This little code is calculating 100% accurately all kind of FedEx services. and there is no handicap because it is running from your server. The only thing you need to is you should call fedex and ask for zone list for your zip code. I have attached database file which is for my location.
    Author: Ayhan
    Views: 14,774
    Posted Date: Saturday, September 18, 2004
  • UPS XML address verification with Coldfusion
    Why need UPS address validation? Answer is; to provide time and transit information to the customers. UPS needs right City State and Zip Code to able give time and transit information. I have submitted another example which I have combined time&trasit information with rating, also tracking tutorial. You should know that this tutorial is made for my needs. If you want to expand, please visit www.ec.ups.com and download instruction. Dont afraid of size the booklet:) you will only need the request inputs and response outputs. It is easy to use. I will suggest you use cfdump to see all variables you get from ups servers. I hope these will save your hours.
    Author: Ayhan
    Views: 16,013
    Posted Date: Thursday, May 12, 2005
  • UPS XML Time&Transit+Rates with Coldfusion
    This is complete rating and Time&Transit tutorial for UPS. to use this you must provide verified address. I have added another tutorial which shows how to verify an address. You should know that this tutorial is made for my needs. If you want to expand, please visit www.ec.ups.com and download instruction. Dont afraid of size the booklet:) you will only need the request inputs and response outputs. It is easy to use. I will suggest you use cfdump to see all variables you get from ups servers.
    Author: Ayhan
    Views: 16,448
    Posted Date: Thursday, May 12, 2005
Download the EasyCFM.COM Browser Toolbar!