In my code I am running two cfsearches. The results from the second search
need to appear at the top of the results from the first search. So I append
them to the first set and manually set the score and the rank so can force the
results to the top in a query of a query.
That is where I am getting the error, but it only happens at certain times.
The query of the query is a basic query,
select * from sResults order by Score desc, Rank desc.
In my search I can search for "wage cost", ââ¬Ålabor marketââ¬Â, or
"wager" and it works just fine, if I try searching for "wage", "wages", or
"labor" it bombs. The error I get is java.lang.ClassCastException which the
line it is on is the beginning line of query of the query. If I take the sort
by Rank desc everything works, but then my results are not quite the way I
would like them.
<cfsearch collection="collection1"
name="sResults"
criteria="#client.criteria#"
categorytree="#variables.cattree#"
status="info">
<cfsearch collection="collection2"
name="sResults2"
criteria="#client.criteria#"
status="info2">
<cfif sResults2.RecordCount gt 0>
<cfset rrank = sResults.RecordCount + 1>
<cfoutput query="sResults2">
<cfset temp = QueryAddRow(sResults)>
<cfset temp = QuerySetCell(sResults, "KEY",
expandpath(sResults2.Custom1))>
<cfset temp = QuerySetCell(sResults, "Rank",
variables.rrank)>
<cfset temp = QuerySetCelL(sResults, "Score", 1.0000)>
<cfset temp = QuerySetCell(sResults, "Summary",
sResults2.Summary)>
<cfset temp = QuerySetCell(sResults, "Title", sResults2.Title)>
<cfset temp = QuerySetCell(sResults, "URL", sResults2.Custom1)>
<cfset temp = QuerySetCell(sResults, "Custom1", sResults2.Key)>
<cfset rrank = rrank + 1>
</cfoutput>
</cfif>
<cfif sResults.RecordCount gt 0>
<cfquery dbtype="query" name="results">
select * from sResults order by Score desc, Rank desc
</cfquery>
<cfwddx action="CFML2WDDX" input="#results#" output="client.qoqResults">
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260162
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4