294
Document fields
You can specify the values for the
as document fields for use with relational operators in the
Document fields are referenced in text comparison operators. They are identified as:
For more information on this topic, see the Knowledge Base article, "Verity: Using
Document Fields To Narrow Down Searches" (ID# 1082) on our Web site at http://
www.coldfusion.com/Support/KnowledgeBase/SearchForm.cfm.
The SUBSTRING operator
You can use the SUBSTRING operator to match a character string with data stored in
a specified data source. In the example described in this section, a data source called
TEST1 contains the table YearPlaceText, which itself contains three columns: Year,
Place, and Text. Year and Place make up the primary key. The following table shows
the TEST1 schema:
Year
1990
1990
1991
1991
1992
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 for 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
<cfquery name="GetText"
</cfquery>
<cfindex collection="testcollection"
CF_TITLE
CF_KEY
CF_URL
CF_CUSTOM1
CF_CUSTOM2
Place
Utah
Oregon
Utah
Oregon
Utah
cfindex
datasource="TEST1">
SELECT Year+Place
AS Identifier, text
FROM YearPlaceText
action="Update"
type="Custom"
title="Identifier"
Chapter 15 Indexing and Searching Data
attributes TITLE, KEY, URL, and CUSTOM
cfindex
tag.
criteria
Text
Text about Utah 1990
Text about Oregon 1990
Text about Utah 1991
Text about Oregon 1991
Text about Utah 1992
attribute.
Need help?
Do you have a question about the COLDFUSION 5-DEVELOPING and is the answer not in the manual?
Questions and answers