Adobe COLDFUSION 9 Manual page 506

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
<html>
<head>
<title>Search Results</title>
</head>
<body>
<cfsearch
collection="#Form.collname#"
name="getEmps"
criteria="#Form.Criteria#"
maxrows = "100">
<!--- Output the record set. --->
<cfoutput>
Your search returned #getEmps.RecordCount# file(s).
</cfoutput>
<cfoutput query="getEmps">
<p><table>
<tr><td>Title: </td><td>#Title#</td></tr>
<tr><td>Score: </td><td>#Score#</td></tr>
<tr><td>Key: </td><td>#Key#</td></tr>
<tr><td>Summary: </td><td>#Summary#</td></tr>
<tr><td>Custom 1:</td><td>#Custom1#</td></tr>
<tr><td>Column list: </td><td>#ColumnList#</td></tr>
</table></p>
</cfoutput>
</body>
</html>
Save the file as collection_db_results.cfm in the myapps directory under the web_root.
4
5
View collection_db_search_form.cfm in the web browser and enter the name of the collection and search terms.
Indexing a file returned by using a query
You can index an individual file that uses a query by retrieving a table row whose contents are a filename. In this case,
the key specifies the column that contains the complete filename. The file is indexed using the
document under the web server root folder.
In the following example, the
the column that contains the full path to the file and the filename.
<cfquery name="getEmps" datasource="cfdocexamples">
SELECT * FROM EMPLOYEE WHERE EMP_ID = 1
</cfquery>
<cfindex
query="getEmps"
collection="CodeColl"
action="Update"
type="file"
key="Contract_File"
title="Contract_File"
body="Emp_ID,FirstName,LastName,Contract_File">
tag's
attribute has been set to
cfindex
type
Last updated 8/5/2010
cfindex
, and the specified key is the name of
file
501
tag as if it is a

Advertisement

Table of Contents
loading

Table of Contents