Lucee Tag Reference
<cfsearch>
Executes searches against data indexed
Body
This tag can't have a body.
Example
<cfsearch [category=string] [categorytree=string] collection=string [contextbytes=number] [contexthighlightbegin=string] [contexthighlightend=string] [contextpassagelength=number] [contextpassages=number] [criteria=string] [external=boolean] [language=string] [maxrows=number] name=string [previouscriteria=string] [startrow=number] [status=string] [suggestions=string] [type=string]>
This tag is also supported within cfscript
<cfscript> search [category=string] [categorytree=string] collection=string [contextbytes=number] [contexthighlightbegin=string] [contexthighlightend=string] [contextpassagelength=number] [contextpassages=number] [criteria=string] [external=boolean] [language=string] [maxrows=number] name=string [previouscriteria=string] [startrow=number] [status=string] [suggestions=string] [type=string]; </cfscript>
Attributes
The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
| Name | Type | Required | Description |
|---|---|---|---|
| category | string | No | A list of categories, separated by commas, to which the search is limited. If specified, and the collection does not have categories enabled, Lucee throws an exception. |
| categorytree | string | No | The location in a hierarchical category tree at which to start the search. Lucee searches at and below this level. If specified, and the collection does not have categories enabled, Lucee throws an exception. Can be used in addition to category attribute. |
| collection | string | Yes | The logical collection name that is the target of the search operation or an external collection with fully qualified path. |
| contextbytes | number | No | The maximum total length in bytes of all returned paragraphs combined. If this limit is reached, no additional paragraphs will be returned even if contextPassages hasn't been reached yet. Default: 1000 |
| contexthighlightbegin | string | No | HTML tag or text to insert before each matched search term. The resulting tag will automatically include a score attribute showing the match relevance, e.g. searchterm Default: |
| contexthighlightend | string | No | HTML tag or text to insert after each matched search term. Works in conjunction with contextHighlightBegin to highlight search terms in the returned paragraphs. Default: |
| contextpassagelength | number | No | Used as a guide for splitting the text into paragraphs. The splitter tries to keep paragraphs close to this length while maintaining natural text boundaries. Note that paragraphs may exceed this length if no suitable break point is found. Default: 150 |
| contextpassages | number | No | Maximum number of text paragraphs to return that contain matches for the search terms. Each paragraph is scored based on how well it matches the search terms, and only the highest scoring paragraphs are returned. A value of 0 means no context is returned. Default: 0 |
| criteria | string | No | Specifies the criteria for the search following the syntactic rules specified by type. |
| external | boolean | No | This Attribute is deprecated |
| language | string | No | This Attribute is deprecated |
| maxrows | number | No | Specifies the maximum number of entries for index queries. If omitted, all rows are returned. |
| name | string | Yes | A name for the search query. |
| previouscriteria | string | No | The name of a result set from an existing set of search results. Lucene searches the result set for criteria without regard to the previous search score or rank. Use this attribute to implement searching within result sets. |
| startrow | number | No | Specifies the first row number to be retrieved. Default is 1. |
| status | string | No | Specifies the name of the structure variable into which Lucee places search information, including alternative criteria suggestions (spelling corrections). |
| suggestions | string | No | Specifies whether Lucene returns spelling suggestions for possibly misspelled words. |
| type | string | No | Specifies the criteria type for the search. |