Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 499

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
<cfindex collection="#Form.IndexColl#"
action="update"
extensions=".htm, .html, .xls, .txt, .mif, .doc, .pdf"
key="#Form.IndexDir#"
type="path"
urlpath="#Form.urlPrefix#"
recurse="Yes"
language="English"
category="taste, touch, sight, sound, smell"
categoryTree="human/senses/taste">
For more information on using the
in the CFML Reference.
Searching collections that contain categories
When searching data in a collection created with categories, you specify
supplied to these attributes specify the category to be searched for the specified search string (the
The
attribute can contain a comma-separated list of categories to search. Both attributes can be specified at
category
the same time.
<cfsearch collection="collectionName"
name="results"
maxrows = "100"
criteria="search keywords"
category="FAQ,Technote"
categoryTree="Docs/Tags">
Note: If
is executed on a collection that was created without category information, an exception is thrown.
cfsearch
To search collections that contain categories, you use the
within specified categories. The following example lets the user enter and submit the name of the collection, the
category in which to search, and the document tree associated with the category through a form. By restricting the
search in this way, the users are better able to retrieve the documents that contain the information they are looking for.
In addition to searching with a specified category, this example also makes use of the
which highlights the returned search results.
<cfparam name="collection" default="test-pi">
<cfoutput>
<form action="#CGI.SCRIPT_NAME#" method="POST">
Collection Name: <input Type="text" Name="collection" value="#collection#">
<P>
Category: <input Type="text" Name="category" value=""><br>
CategoryTree: <input Type="text" Name="categoryTree" value=""><br>
<P>
Search: <input Type="text" Name="criteria">
<input Type="submit" Value="Search">
</form>
</cfoutput>
<cfif isdefined("Form.criteria")>
<cfoutput>Search results for: <b>#criteria#</b></cfoutput>
<br>
<cfsearch collection="#form.collection#"
category="#form.category#"
categoryTree="#form.categoryTree#"
name="sr"
tag to create Verity collections with support for categories, see
cfindex
cfsearch
Last updated 1/20/2012
and
category
categoryTree
criteria
tag, and create an application page that searches
contextHighlight
494
cfindex
. The values
attribute).
attribute,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents