Adobe COLDFUSION 9 Manual page 490

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Indexing a collection by using the cfindex tag
You can index a collection in CFML by using the
Administrator. The
cfindex
can use the
tag to index either physical files (documents stored within your website's root folder), or the
cfindex
results of a database query.
Note: Before indexing a collection, create a Verity collection by using the ColdFusion Administrator, or the
tag. For more information, see
cfcollection
or
"Creating a collection with the cfcollection
When using the
tag, the following attributes correspond to the values that you would enter by using the
cfindex
ColdFusion Administrator to index a collection:
Attribute
Description
The name of the collection.
collection
action
Specifies what the
which generates a new index. Other
Specifies the type of files or other data to which the
type
assign to the
enter a value for the
if you specify
The
type
file
path
custom
(Optional) The delimited list of file extensions that ColdFusion uses to index files if
extensions
key
The value that you specify for the
If
type="file"
If
type="path"
If
type="custom"
for example, the URL of a specific web page or website whose contents you want to index
data returned by a query (from a database for example), the
contains the primary key.
(Optional) The URL path for files if
URLpath
cfsearch tag, ColdFusion works as follows:
type="file"
type="path"
recurse
(Optional)
attribute are included in the indexing operation.
(Optional) The language of the collection. The default language is English Basic.
language
To learn more about support for languages, see
You can use form and action pages like the following examples to select and index a collection.
Select which collection to index
1
Create a ColdFusion page with the following content:
cfindex
tag populates the collection with metadata that is then used to retrieve search results. You
"Creating a collection with the ColdFusion
tag" on page 482.
cfindex
tag should do to the collection. The default
actions
attribute determines the value to use with the
type
attribute,
type
cfindex
,
expects a directory path and filename for the
type=file
cfindex
attribute has the following possible values:
: Specifies a directory path and filename for the file that you are indexing.
: Specifies a directory path that contains the files that you are indexing.
: Specifies custom data, such as a recordset returned from a query.
key
attribute depends on the value set for the
, the
key
is the directory path and filename for the file you are indexing
, the
key
is the directory path that contains the files you are indexing
, the
is a unique identifier specifying the location of the documents you are indexing;
key
type="file"
: The
attribute contains the URL to the file.
URLpath
: The path name is automatically prefixed to filenames and returned as the
Yes
or
No
. If
type = "path"
Last updated 8/5/2010
tag, which eliminates the need to use the ColdFusion
action
are to delete, purge, or refresh the collection.
tag applies the specified action. The value you
cfindex
attribute (see the following list). When you
key
expects a corresponding value in the
key
is the name of the recordset column that
and
. When the collection is searched with the
type="path"
,
Yes
specifies that directories below the path specified in the key
"Specifying a
language" on page 479.
Administrator" on page 481,
is to update the collection,
attribute. For example,
key
attribute.
key
type="path".
type
attribute:
.
.
.
If you are indexing
URLpath
attribute.
485

Advertisement

Table of Contents
loading

Table of Contents