User Guide

Table Of Contents
Enhancing search results 565
To create a search results page using term highlighting:
1.
Create a ColdFusion page with the following content:
<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>
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:
4.
Enter a target word(s) 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
cfsearch tags suggestions attribute
with an integer 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
suggestions attribute, you may also use the cfif tag to output the spelling suggestions, and a
link through which to search on the suggested terms.