The CFX_SEARCH Tag

Use the CFX_SEARCH tag to execute searches against indexed data in Verity collections. Collections must be created and populated before any searches can be executed.

CFX_SEARCH
NAME Required. A name for the search query.
COLLECTION Required. Specifies the logical collection name that is the target of the search operation. Multiple collections can be specified in a comma separated list:
COLLECTION="CFUSER, CFLANG" 
TYPE Optional. Specifies the criteria type for the search. Valid entries are:
  • SIMPLE - By default the STEM and MANY operators are used
  • EXPLICIT - All operators must be invoked explicitly
CRITERIA Optional. Specifies the criteria for the search following the syntactic rules specified by TYPE.
MAXROWS Optional. Specifies the maximum number of entries for index queries. If omitted, all rows are returned.
STARTROW Optional. Specifies the first row number to be retrieved. Default is 1.

Basic search operation

Conducting a basic search is very straightforward using the CFX_SEARCH tag. In the following example, a simple search for the word "database" is performed on a collection called "DOCS."

<CFX_SEARCH
   NAME="DocSearch"
   COLLECTION="DOCS"
   TYPE="Simple"
   CRITERIA="database">

You use the CFOUTPUT tag to present the results of your search to your user. The following example shows a CFOUTPUT example, complete with fully defined URL:

<CFOUTPUT QUERY="DocSearch">
   <A HREF="#DocSearch.url#">#DocSearch.Title#</A><BR>
</CFOUTPUT>

Result columns

Every search conducted with the CFX_SEARCH tag returns, as part of the result set, four result columns you can reference in your CFOUTPUT:

You can use these result columns in standard CFML expressions, preceding the result column name with the name of the query:

#DocSearch.URL# 
#DocSearch.KEY#
#DocSearch.TITLE#
#DocSearch.SCORE#