I am developing a Flash Builder\ Flex Mobile application using ColdFusion. I need help to fix my search function. When I try to search for something, I must enter the exact word or it returns nothing.
If I type only "app"
, instead of "applet"
, it returns nothing.
Search function:
<cffunction name="getwordsSummaryByTerm" output="false" access="remote" returntype="Query" >
<cfargument name="searchStr" type="string" required="true" />
<cfset var qItem="">
<cfquery name="qItem" datasource="databaseyo">
SELECT *
FROM words
WHERE term = <CFQUERYPARAM CFSQLTYPE="CF_SQL_VARCHAR" VALUE="#ARGUMENTS.searchStr#">
</cfquery>
<cfreturn qItem>
</cffunction>
Flex code:
protected function doSearch(event:MouseEvent):void
{
if(searchTerm.text!="")
{
getAllwordsResult.token = wordsService.getwordsSummaryByTerm(searchTerm.text);
}
else
{
getAllwordsResult.token = wordsService.getAllwords();
}
}