User Guide

Chapter 1: ColdFusion Tags 187
SUMMARY — Returns the contents of the automatic summary generated by
CFINDEX. The default summarization selects the best three matching
sentences, up to a maximum of 500 characters.
RECORDCOUNT — Returns the number of records returned in the record set.
CURRENTROW — Returns the current row being processed by CFOUTPUT.
COLUMNLIST — Returns the list of the column names within the record set.
RECORDSSEARCHED— Returns the number of records searched.
You can use these result columns in standard CFML expressions, preceding the result
column name with the name of the query:
#DocSearch.URL#
#DocSearch.KEY#
#DocSearch.TITLE#
#DocSearch.SCORE#
Example <!--- This example shows how to utilize CFSEARCH
to search an existing, populated collection --->
<HTML>
<HEAD>
<TITLE>
CFSEARCH Example
</TITLE>
</HEAD>
<BODY bgcolor=silver>
<H3>CFSEARCH Example</H3>
<!--- To index the collection, select the check box
on the form --->
<CFIF IsDefined("form.IndexCollection")>
<!--- Change KEY and URLPATH to reflect accurate key and URL
<CFINDEX ACTION="UPDATE" COLLECTION="Snippets"
KEY="c:\inetpub\wwwroot\cfdocs\snippets" TYPE="PATH"
TITLE="This is my test" URLPATH="http://127.0.0.1/cfdocs/snippets/"
EXTENSIONS=".cfm" RECURSE="Yes">
<H3>Collection re-indexed</H3>
</CFIF>
<CFIF IsDefined("form.source") AND
IsDefined("form.type") AND IsDefined("form.searchstring")>
<!--- actually conduct the search --->
<CFSEARCH NAME="SearchSnippets"
COLLECTION="#form.source#"
TYPE="#form.type#"
CRITERIA="#form.searchstring#">
<!--- print out the search results --->
<CFOUTPUT>
<H2>#form.type# Search Results</H2>