User Guide

Table Of Contents
564 Chapter 24: Building a Search Interface
2.
Save the file as collection_search_action.cfm.
3.
View collection_search_form.cfm in the web browser.
4.
Enter a target word(s) and click Search.
Note: As part of the indexing process, Verity automatically produces a summary of every document
file or every query record set that gets indexed. The default summary result set column selects the
best sentences, based on internal rules, up to a maximum of 500 characters. Every
cfsearch
operation returns summary information by default. For more information on this topic, see “Using
Verity Search Expressions” on page 581. Alternatively, you can use the context result set column,
which provides a context summary with highlighted search terms.
Enhancing search results
ColdFusion lets you enhance the results of searches by letting you incorporate search features that
let users more easily find the information they need. The following search enhancements are
available through Verity:
“Highlighting search terms” on page 564
“Providing alternative spelling suggestions” on page 565
“Narrowing searches using categories” on page 567
Highlighting search terms
Term highlighting lets users quickly scan retrieved documents to determine whether they contain
the desired information. This can be especially useful when searching lengthy documents, letting
users quickly locate relevant information returned by the search.
To implement term highlighting, use the following
cfsearch attributes in the search results page:
The following example adds to the previous search results example, highlighting the returned
search terms with bold type.
Attributes Description
ContextHighlightBegin Specifies the HTML tag to prepend to the search term within the returned
documents. This attribute must be used in conjunction with
ContextHighlightEnd to highlight the resulting search terms. The default
HTML tag is <b>, which highlights search terms using bold type.
ContextHighlightEnd Specifies the HTML tag to append to the search term within the returned
documents.
ContextPassages The number of passages/sentences Verity returns in the context summary
(the context column of the results). The default value is 0; this disables the
context summary.
ContextBytes The total number of bytes that Verity returns in the context summary. The
default is 300 bytes.