Adobe COLDFUSION 9 Manual page 496

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#"
ContextHighlightBegin="<b>"
ContextHighlightEnd="</b>"
ContextPassages="1"
ContextBytes="500"
maxrows = "100">
<h2>Search Results</h2>
<cfoutput>
Your search returned #codecoll_results.RecordCount# file(s).
</cfoutput>
<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>
Save the file as collection_search_action.cfm.
2
Note: This overwrites the previous ColdFusion example page.
View collection_search_form.cfm in the web browser:
3
4
Enter target words and click Search.
Providing alternative spelling suggestions
Many unsuccessful searches are the result of incorrectly spelled query terms. Verity can automatically suggest
alternative spellings for misspelled queries using a dictionary that is dynamically built from the search index.
To implement alternative spelling suggestions, you use the
value. If the number of documents returned by the search is less than or equal to the value you specify, Verity provides
alternative search term suggestions. In addition to using the
output the spelling suggestions, and a link through which to search on the suggested terms.
Note: Using alternative spelling suggestions incurs a small performance penalty. This occurs because the cfsearch tag must
also look up alternative spellings in addition to the specified search terms.
The following example specifies that if the number of search results returned is less than or equal to 5, an alternative
search term—which is displayed using the
alternate search.
Create a search results page that provides alternative spelling suggestions
Create a ColdFusion page with the following content:
1
tag's
cfsearch
suggestions
tag—is displayed with a link that the user can click to activate the
cfif
Last updated 8/5/2010
attribute with an integer
suggestions
attribute, you can also use the
491
tag to
cfif

Advertisement

Table of Contents
loading

Table of Contents