CFSEARCHing for my #SUMMARY#

CFSEARCHing for my #SUMMARY#

Post by mhuar » Sat, 17 May 2003 05:01:22



We're in the process of testing our upgrade to MX.  Currently we're having a problem getting the our collection's summary to display.  this is the code we have:

to create and index the collections:

<cfquery name="cross_ref_qry" datasource=#Datasource# dbtype=#Dbtype#>
        SELECT
                contract_number,
                contract_line_nbr,
                commodity_number,
                estimated_unit_pri,
                unit_of_measure,
                brand,
                model,
                discount_pct
        FROM
                #crossRefTable#
        ORDER BY contract_number DESC, contract_line_nbr DESC
</cfquery>

<cfset total_rows = cross_ref_qry.recordCount>
        <cfcollection action="create" collection="commcoll1" path="d:\CFusionMX\verity\collections\">
<cfset qry = QueryNew("KEY, TITLE, BODY, CUSTOM1, CUSTOM2")>
<cfset temp = QueryAddRow(qry, 250)>
<cfset row = 1>
<cfloop query="cross_ref_qry" startrow=1 endrow=250>
        <cfset temp = QuerySetCell(qry, "KEY", Trim(cross_ref_qry.contract_number) & "|" & Trim(cross_ref_qry.contract_line_nbr), row)>
        <cfif UCase(Trim(cross_ref_qry.unit_of_measure)) Is "DISC">
        <cfset costString = "Unit Price: #cross_ref_qry.discount_pct#, Unit: #Trim(cross_ref_qry.unit_of_measure)#">
        <cfelse>
                <cfset costString = "Unit Price: #cross_ref_qry.estimated_unit_pri#, Unit: #Trim(cross_ref_qry.unit_of_measure)#">
        </cfif>
        <cfset temp = QuerySetCell(qry, "TITLE",
                "Contract## #Trim(cross_ref_qry.contract_number)#, Line## #Trim(cross_ref_qry.contract_line_nbr)#, #costString#",
                row)>

        <cfset temp = QuerySetCell(qry, "CUSTOM1", cross_ref_qry.commodity_number, row)>
        <cfset temp = QuerySetCell(qry, "CUSTOM2", cross_ref_qry.contract_number, row)>

        <cfquery name="linedesc_qry" datasource=#Datasource# dbtype=#Dbtype#  >
                SELECT description
                FROM #lineDescTable#
                WHERE contract_number = '#cross_ref_qry.contract_number#' AND contract_line_nbr = '#cross_ref_qry.contract_line_nbr#'
                ORDER BY descrip_line_nbr
        </cfquery>

        <cfset tempstring = "Brand: #Trim(cross_ref_qry.brand)#, Model: #Trim(cross_ref_qry.model)#, Commodity## #Trim(cross_ref_qry.commodity_number)#<br>">
        <cfloop query="linedesc_qry">
                        <cfset tempstring = tempstring & Trim(linedesc_qry.description) & " ">
        </cfloop>
        <cfset temp = QuerySetCell(qry, "BODY", tempstring, row)>

        <cfset row = row + 1>
        </cfloop>

<cfindex action="refresh" collection="commcoll1"
        type="CUSTOM" query="qry"
        key="KEY"
        title="TITLE"
        body="BODY"
        custom1="CUSTOM1"
        custom2="CUSTOM2">

to display the key, title, and summary

<html>
<head></head>
<body>
<cfsearch NAME="qry"
        COLLECTION="commcoll1"
        TYPE="EXPLICIT"
        MAXROWS=50>
<cfloop query="qry" startrow=1 endrow=50><cfoutput>
        key:  #qry.KEY# <br>
        title: #qry.TITLE# <br>
        Summary: #qry.SUMMARY# <br><hr>
        </cfoutput>      
</cfloop>
</body>
</html>

Our key and title are displaying, but summary is blank.  It works with CF 5.0.

Any suggestions would be greatly appreciated.

Thanks,
Matt