cfsearch

Searches Verity collections using CFML or K2Server, whichever search engine a collection is registered by.
(CFML can also search collections that have not been
registered, with the cfcollection tag.)

A collection must be created and indexed before this tag can
return search results.

  <cfsearch name="" collection="">

 cfsearch(name="", collection="");

Attribute Reference

name string
Required

Name of the search query.

collection string
Required

One or more collection names. You can specify more
than one collection unless you are performing a
category search (that is, specifying category or
categoryTree).

One or more collection names. You can specify more
than one collection unless you are performing a category search (that is, specifying category or categoryTree).

category string

A list of categories, separated by commas, to which
the search is limited. If specified, and the collection
does not have categories enabled, ColdFusion

throws an exception.

categorytree string

The location in a hierarchical category tree at which
to start the search. ColdFusion searches at and
below this level. If specified, and the collection does
not have categories enabled, ColdFusion throws an
exception. Can be used in addition to category
attribute.

status string

Specifies the name of the structure variable into
which ColdFusion places search information, including
alternative criteria suggestions (spelling corrections).

type string
Default: simple

Used to specify the parser that Verity/SOLR uses to process
the criteria.
Values:
  • simple
  • explicit
  • internet
  • internet_basic
  • natural
  • standard
  • dismax
  • Standard
  • DisMax

criteria string

Search criteria. Follows the syntax rules of the type
attribute. If you pass a mixed-case entry in this attribute,
the search is case-sensitive. If you pass all uppercase or
all lowercase, the search is case-insensitive. Follow
Verity syntax and delimiter character rules; see Using Verity Search Expressions in Developing CFML MX Applications.

maxrows numeric
Default: all

Maximum number of rows to return in query results.
Default: all

startrow numeric
Default: 1

First row number to get.
Default: 1

suggestions string
Default: never

Specifies whether Verity/SOLR returns spelling suggestions
for possibly misspelled words.
Values:
  • always
  • never

contextPassages numeric
Default: 3

The number of passages/sentences Verity returns in
the context summary (that is, the context column of
the results).
Default: 3

contextBytes numeric
Default: 300

The maximum number of bytes Verity returns in the
context summary.
Default: 300

contextHighlightBegin string
Default: <b>

The HTML to prepend to search terms in the context
summary. Use this attribute in conjunction with
contextHighlightEnd to highlight search terms in the
context summary.

contextHighlightEnd string
Default: </b>

The HTML to prepend to search terms in the context
summary. Use this attribute in conjunction with
contextHighlightEnd to highlight search terms in the
context summary.

previousCriteria string

The name of a result set from an existing set of search
results. Verity searches the result set for criteria
without regard to the previous search score or rank.
Use this attribute to implement searching within result
sets.

language string

Deprecated. This attribute is now ignored and the language of the collection is used to perform the search.

Compatibility

ColdFusion:

Version 3+ The following types are not supported anymore in CF2016+: simple, explicit, internet, internet_basic and natural

Examples
Sample code using the cfsearch tag

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub