cfindex

Populates a Verity search engine collection with an index of
documents on a file system or of CFML query result sets.

A collection must exist before it can be populated.

  <cfindex collection="">

 cfindex(collection="");

Attribute Reference

collection string
Required

Name of a collection that is registered by CFML; for
example, "personnel"
Name and absolute path of a collection that is not
registered by CFML; for example:
"e:\collections\personnel"

action string

- update: updates a collection and adds key to the index.
- delete: removes collection documents as specified by
the key attribute.
- purge: deletes all of the documents in a collection.
Causes the collection to be taken offline, preventing
searches.
- refresh: deletes all of the documents in a collection,
and then performs an update.
Values:
  • update
  • delete
  • purge
  • refresh

type string

file: using the key attribute value of the query result as
input, applies action value to filenames or filepaths.
path: using the key attribute value of the query result as
input, applies action to filenames or filepaths that
pass the extensions filter
custom: If action = "update" or "delete": applies action to
custom entities in query results.
Values:
  • file
  • path
  • custom

title string

* Title for collection
* Query column name for type and a valid query name
Permits searching collections by title or displaying a
separate title from the key

key string

* Absolute path and filename, if type = "file"
* Absolute path, if type = "path"
* A query column name (typically, the primary key column
name), if type = "custom"
* A query column name, if type = any other value

This attribute is required for the actions listed, unless
you intend for its value to be an empty string.

body string

* ASCII text to index
* Query column name(s), if name is specified in query

You can specify columns in a delimited list. For example:
"emp_name, dept_name, location"

custom1 string

Custom field in which you can store data during an indexing
operation. Specify a query column name for type, and a
query name.

custom2 string

Custom field in which you can store data during an indexing
operation. Specify a query column name for type, and a
query name.

custom3 string

Custom field in which you can store data during an indexing
operation. Specify a query column name for type, and a
query name. (Added in ColdFusion 7)

custom4 string

Custom field in which you can store data during an indexing
operation. Specify a query column name for type, and a
query name. (Added in ColdFusion 7)

category string

A string value that specifies one or more search categories
for which to index the data. You can define multiple
categories, separated by commas, for a single index.

categoryTree string

A string value that specifies a hierarchical category or
category tree for searching. It is a series of categories
separated by forward slashes ("/"). You can specify only
one category tree.

urlpath string

If type="file" or "path", specifies the URL path. When the
collection is searched with cfsearch, this pathname is
prefixed to filenames and returned as the url attribute.

extensions string

Delimited list of file extensions that CFML uses to
index files, if type = "Path".
"*." returns files with no extension.

For example: the following code returns files with a
listed extension or no extension:
extensions = ".htm, .html, .cfm, .cfml, "*."

query query

Query against which collection is generated

recurse boolean
Default: false

Yes: if type = "path", directories below the path
specified in key are included in indexing operation
Values:
  • true
  • false

language string
Default: english

For options, see cfcollection. Requires the appropriate
Verity Locales language pack (Western Europe, Asia,
Multilanguage, Eastern Europe/Middle Eastern).

status string

The name of the structure into which ColdFusion MX
returns status information.

prefix string

Specifies the location of files to index when the computer that contains the K2 Search Service is not the computer on which you installed ColdFusion, and when you index files with the type attribute set to path.

Examples
Sample code using the cfindex tag

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub