
495
DEVELOPING
COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Las
t
upda
te
d 8/5/2010
status="s"
criteria="#form.criteria#"
contextPassages="3"
contextBytes="300"
contextHighlightBegin="<i><b>"
contextHighlightEnd="</b></i>"
maxrows="100">
<cfdump var="#s#">
<cfoutput>
<p>Number of records in query: #sr.recordcount#</P>
</cfoutput>
<cfdump var="#sr#">
<cfoutput Query="sr">
Title: <i>#title#</i><br>
URL: #url#<br>
Score: #score#<br>
<hr>
#context#<br>
<br>
#summary#<br>
<hr>
</cfoutput>
</cfif>
For more information on using the
cfindex
tag to create Verity collections with support for categories, see
cfsearch
in the
CFML Reference
.
Retrieving information about the categories contained in a collection
You can retrieve the category information for a collection by using the
cfcollection
tag’s
categoryList
action.The
categoryList
action returns a structure that contains two keys:
Use the information returned by
categoryList
to display to users the number of documents available for searching,
as well the document tree available for searching. You can also create a search interface that lets the user select what
category to search within based on the results returned by
categoryList
.
<cfcollection
action="categoryList"
collection="collectionName"
name="info">
<cfoutput>
<cfset catStruct=info.categories>
<cfset catList=StructKeyList(catStruct)>
<cfloop list="catList" index="cat"> Category: #cat# <br>
Documents: #catStruct[cat]#<br>
</cfloop>
</cfoutput>
Variable
Description
categories
The name of the category and its hit count, where hit count is the number of documents in the specified category.
categorytrees
The document tree (a/b/c) and hit count, where hit count is the number of documents at or below the branch of the
document tree.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...