Adobe COLDFUSION 9 Manual page 497

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
<html>
<head>
<title>Search Results</title>
</head>
<body>
<cfsearch
name = "codecoll_results"
collection = "CodeColl"
criteria = "#Form.Criteria#">
status = "info"
suggestions="5"
ContextPassages = "1"
ContextBytes = "300"
maxrows = "100">
<h2>Search Results</h2>
<cfoutput>
Your search returned #codecoll_results.RecordCount# file(s).
</cfoutput>
<cfif info.FOUND LTE 5 AND isDefined("info.SuggestedQuery")>
Did you mean:
<a href="search,cfm?query=#info.SuggestedQuery#>#info.SuggestedQuery#</a>
</cfif>
<cfoutput query="codecoll_results">
<p>
File: <a href="#URL#">#Key#</a><br>
Document Title (if any): #Title#<br>
Score: #Score#<br>
Summary: #Summary#<br>
Highlighted Summary: #context#</p>
</cfoutput>
</body>
</html>
2
Save the file as collection_search_action.cfm.
Note: This overwrites the previous ColdFusion example page.
3
View collection_search_form.cfm in the web browser:
Enter any misspelled target words and click Search.
4
Narrowing searches by using categories
Verity lets you organize your searchable documents into categories. Categories are groups of documents (or database
tables) that you define, and then let users search within them. For example, if you wanted to create a search tool for a
software company, you can create categories such as whitepapers, documentation, release notes, and marketing
collateral. Users can then specify one or more categories in which to search for information. Thus, if users visiting the
website wanted to learn about a conceptual aspect of your company's technology, they might restrict their search to
the whitepaper and marketing categories.
Typically, you provide users with pop-up menus or check boxes from which they can select categories to narrow their
searches. Alternately, you can create a form that lets users enter both a category name in which to search, and search
keywords.
Create a search application that uses categories
1
Create a collection with support for categories enabled.
Last updated 8/5/2010
492

Advertisement

Table of Contents
loading

Table of Contents