Lucee Tag Reference
Tag <CFINDEX>
Populates collections with indexed data. The cfindex and cfsearch tags encapsulate the
indexing and searching utilities. Collections can be populated from text files in a directory
you specify, or from a query generated by a query. Before you can populate a collection,
you must create the collection using either the cfcollection tag or the Lucee Administrator. Use
cfsearch to search collections you populate with cfindex.
Body
This tag can't have a body.
Example
<cfindex action="string" [body="string"] [category="string"] [categorytree="string"] collection="string" [custom1="string"] [custom2="string"] [custom3="string"] [custom4="string"] [extensions="string"] [external="boolean"] [key="string"] [language="string"] [name="string"] [prefix="string"] [query="string"] [recurse="boolean"] [status="string"] [throwontimeout="boolean"] [timeout="number"] [title="string"] [type="string"] [urlpath="string"]>
This tag is also supported within cfscript
<cfscript> index action="string" [body="string"] [category="string"] [categorytree="string"] collection="string" [custom1="string"] [custom2="string"] [custom3="string"] [custom4="string"] [extensions="string"] [external="boolean"] [key="string"] [language="string"] [name="string"] [prefix="string"] [query="string"] [recurse="boolean"] [status="string"] [throwontimeout="boolean"] [timeout="number"] [title="string"] [type="string"] [urlpath="string"]; </cfscript>
Attributes
The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
Name | Type | Required | Description |
---|---|---|---|
action | string | Yes | Specifies the index action. |
body | string | No | - 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" |
category | string | No | 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 | No | 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. |
collection | string | Yes | Specifies a collection name. If you are indexing an external collection external = "Yes", specify the collection name, including fully qualified path. |
custom1 | string | No | A custom field you can use to store data during an indexing operation. Specify a query column name for type and a query name. |
custom2 | string | No | A custom field you can use to store data during an indexing operation. Usage is the same as for custom1. |
custom3 | string | No | A custom field you can use to store data during an indexing operation. Usage is the same as for custom1. |
custom4 | string | No | A custom field you can use to store data during an indexing operation. Usage is the same as for custom1. |
extensions | string | No | Specifies the comma-separated list of file extensions that Lucee uses to index files if type = "Path". Default is HTM, HTML, CFM, CFML, DBM, DBML. An entry of "*." returns files with no extension |
external | boolean | No | This Attribute is deprecated |
key | string | No | - 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. |
language | string | No | language used to index |
name | string | No | name of the variable generated by action "list" to return the query containing all indexes of a collection. |
prefix | string | No | Specifies the location of files to index when the computer that contains the K2 Search Service is not the computer on which you installed Lucee, and when you index files with the type attribute set to path. |
query | string | No | Specifies the name of the query against which the collection is generated. |
recurse | boolean | No | Yes or No. Yes specifies, if type = "Path", that directories below the path specified in key are included in the indexing operation. |
status | string | No | The name of the structure into which Lucee returns status information. |
throwontimeout | boolean | No | Specifies how timeout conditions are handled. If the value is true, an exception is enerated to provide notification of the timeout. If the value is No, execution continues. Default is no. |
timeout | number | No | the timeout in seconds for a single request of type url |
title | string | No | 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 |
type | string | No | Specifies the type of entity being indexed. Default is CUSTOM. |
urlpath | string | No | Specifies the URL path for files if type = "file" and type = "path". When the collection is searched with cfsearch, the pathname is automatically be prepended to filenames and returned as the url attribute. |