> <cfset firstWordBreak = find(' ',search,1)>
>
> <cfif firstWordBreak>
> <cfset secondWordBreak = find('
>',search,firstWordBreak)>
> </cfif>
>
> <cfif isDefined("secondWordBreak") and secondWordBreak>
> <cfset thirdWordBreak = find('
>',search,secondWordBreak)>
> </cfif>
>
> <cfif isDefined("thirdWordBreak") and thirdWordBreak>
> <cfset fourthWordBreak = find('
>',search,thirdWordBreak)>
> </cfif>
>
>got it.
>
>
>thats what ill do, then mid the strings out, and build the dynamic query
>based on the presence of a 1st, 2nd, 3rd, or 4th word that may be there,
>should i make them separate by commas, since st. anne would return, st.
>joseph as well as many other possibilities, but if i make them separate
>by commas, then ill be good, cause they will be separating it
>themselves, and then i can just find commas....more reliable i think.
>huh?
>
A few things:
1) You might be better off finding a different delimiter if you use your
solution and are expecting search terms like "St. Anne's".
2) You'd probably be better off treating the search terms as a list with a
space as a delimiter instead of the find() function, i.e.:
SELECT myColumn
FROM myTable
WHERE 0 = 0
<cfloop list="#Form.searchTerms#" index="term" delimiter=" ">
AND myColumn LIKE %#term#"%
</cfloop>
This way you don't have to worry about how many search terms are entered,
which your proposed solution seems to be (i.e., "firstWordBreak", etc.)
3) Though not related to breaking up the search terms, why not use Verity? I
think you'll find that the performance and accuracy of your results are
enhanced by creating a collection that's populated by the results of a
database query.
Regards,
Dave.
_________________________________________________________________
Send and receive larger attachments with Hotmail Extra Storage.
http://join.msn.com/?PAGE=features/es
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm