
498
DEVELOPING
COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Las
t
upda
te
d 8/5/2010
When indexing a recordset retrieved from a database, the
cfindex
tag uses the following attributes that correspond
to the data source:
Using the
cfindex
tag to index tabular data is like indexing documents, with the exception that you refer to column
names from the generated recordset in the
body
attribute. In the following example, the
type
attribute is set to
custom
,
specifying that the
cfindex
tag index the contents of the recordset columns Emp_ID, FirstName, LastName, and
Salary, which are identified using the
body
attribute. The Emp_ID column is listed as the
key
attribute, making it the
primary key for the recordset.
Index a ColdFusion query
1
Create a Verity collection for the data that you want to index.
The following example assumes that you have a Verity collection named CodeColl. You can use the ColdFusion
Administrator to create the collection, or you can create the collection programmatically by using the
cfcollection
tag. For more information, see “
Creating a collection with the ColdFusion Administrator
” on
page 481 or “
Creating a collection with the cfcollection tag
” on page 482.
2
Create a ColdFusion page with the following content:
Attribute
Description
key
Primary key column of the data source table.
title
Specifies a query column name.
body
Columns that you want to search for the index.
type
If set to
custom
, this attribute specifies the columns that you want to index. If set to
file
or
path
, this is a column
that contains either a directory path and filename, or a directory path that contains the documents to be indexed.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...