User Guide

176 Developing Web Applications with ColdFusion
The following application page matches records that have 1990 in the TEXT column
and are in the Place Utah. The search is performed against the collection that contains
the TEXT column and then is narrowed further by searching the string "Utah" in the
CF_TITLE document field. Recall that document fields are defaults defined in every
collection corresponding to the values you define for URL, TITLE, and KEY in the
CFINDEX tag.
<CFQUERY NAME="GetText"
DATASOURCE="TEST1">
SELECT Year+Place
AS Identifier, text
FROM YearPlaceText
</CFQUERY>
<CFINDEX COLLECTION="testcollection"
ACTION="Update"
TYPE="Custom"
TITLE="Identifier"
KEY="Identifier"
BODY="TEXT"
QUERY="GetText">
<CFSEARCH NAME="GetText_Search"
COLLECTION="testcollection"
TYPE="Explicit"
CRITERIA="1990 and CF_TITLE <SUBSTRING> Utah">
<CFOUTPUT>
Record Counts: <BR>
#GetText.RecordCount# <BR>
#GetText_Search.RecordCount# <BR>
</CFOUTPUT>
<CFOUTPUT>
Query Results --- Should be 5 rows <BR>
</CFOUTPUT>
<CFOUTPUT QUERY="Gettext">
#Identifier# <BR>
</CFOUTPUT>
<CFOUTPUT>
Search Results -- should be 1 row <BR>
1991 Oregon Text about Oregon 1991
1992 Utah Text about Utah 1992
YearPlaceText (Continued)
Year Place Tex t