<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.

Usage

<cfindex
    [throwontimeout=boolean]
    [prefix=string]
    [language=string]
    [query=string]
    [custom3=string]
    [custom1=string]
    [recurse=boolean]
    [urlpath=string]
    [status=string]
    collection=string
    [categorytree=string]
    [external=boolean]
    [extensions=string]
    [category=string]
    [key=string]
    [name=string]
    [type=string]
    [custom4=string]
    [custom2=string]
    [timeout=number]
    action=list|update|delete|purge|refresh
    [title=string]
    [body=string]
>

This tag cannot have a body.

This tag is also supported within cfscript

Attributes

Attribute Description
throwontimeout
(boolean, optional)

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.

prefix
(string, optional)

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.

language
(string, optional)

language used to index

query
(string, optional)

Specifies the name of the query against which the collection is generated.

custom3
(string, optional)

A custom field you can use to store data during an indexing operation. Usage is the same as for custom1.

custom1
(string, optional)

A custom field you can use to store data during an indexing operation. Specify a query column name for type and a query name.

recurse
(boolean, optional)

Yes or No. Yes specifies, if type = "Path", that directories below the path specified in key are included in the indexing operation.

urlpath
(string, optional)

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.

status
(string, optional)

The name of the structure into which Lucee returns status information.

collection
(string, required)

Specifies a collection name. If you are indexing an external collection external = "Yes", specify the collection name, including fully qualified path.

categorytree
(string, optional)

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.

external
(boolean, optional)

This attribute has been deprecated and is non-functional.

extensions
(string, optional)

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

category
(string, optional)

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.

key
(string, optional)
  • 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.
    
name
(string, optional)

name of the variable generated by action "list" to return the query containing all indexes of a collection.

type
(string, optional)

Specifies the type of entity being indexed. Default is CUSTOM.

custom4
(string, optional)

A custom field you can use to store data during an indexing operation. Usage is the same as for custom1.

custom2
(string, optional)

A custom field you can use to store data during an indexing operation. Usage is the same as for custom1.

timeout
(number, optional)

the timeout in seconds for a single request of type url

action
(string, required)

Specifies the index action.

title
(string, optional)

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

body
(string, optional)
  • 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"
    

Examples

There are currently no examples for this tag.