Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 525

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Operator
Description
NEAR
Selects documents containing specified search terms. The closer the
search terms are to one another within a document, the higher the
document's score. The document with the smallest possible region
containing all search terms always receives the highest score.
Documents whose search terms are not within 1000 words of each
other are not selected.
NEAR/N
Selects documents containing two or more search terms within N
number of words of each other, where N is an integer between 1 and
1024. NEAR/1 searches for two words that are next to each other.
The closer the search terms are within a document, the higher the
document's score.
You can specify multiple search terms using multiple instances of
NEAR/N as long as the value of N is the same.
PARAGRAPH
Selects documents that include all of the words you specify within
the same paragraph. To search for three or more words or phrases in
a paragraph, you must use the PARAGRAPH operator between each
word or phrase.
PHRASE
Selects documents that include a phrase you specify. A phrase is a
grouping of two or more words that occur in a specific order.
SENTENCE
Selects documents that include all of the words you specify within
the same sentence.
IN
Selects documents that contain specified values in one or more
document zones. A document zone represents a region of a
document, such as the document's summary, date, or body text. To
search for a term only within the one or more zones that have
certain conditions, you qualify the IN operator with the WHEN
operator.
The following example uses a proximity operator:
<cfsearch name = "quick_search"
collection="bbb"
type = "explicit"
criteria="red<near>socks">
For an example using the IN proximity operator to search XML documents, see
Score operators
Score operators control how the search engine calculates scores for retrieved documents. The maximum score that a
returned search element can have is 1.000. You can set the score to display a maximum of four decimal places.
When you use a score operator, the search engine first calculates a separate score for each search element found in a
document, and then performs a mathematical operation on the individual element scores to arrive at the final score
for each document.
The document's score is available as a result column. You can use the SCORE result column to get the relevancy score
of any document retrieved, for example:
<cfoutput>
<a href="#Search1.URL#">#Search1.Title#</a><br>
Document Score=#Search1.SCORE#<BR>
</cfoutput>
The following table describes the score operators:
Last updated 1/20/2012
Example
war <NEAR> peace retrieves documents that
contain stemmed variations of these words
within close proximity to each other (as defined
by Verity). To control search proximity, use
NEAR/N.
commute <NEAR/10> bicycle <NEAR/10> train
<NEAR/10> retrieves documents that contain
stemmed variations of these words within 10
words of each other.
<PARAGRAPH> (mission, goal, statement) retrieves
documents that contain these terms within a
paragraph.
<PHRASE> (mission, oak) returns documents that
contain the phrase mission oak.
<SENTENCE> (jazz, musician) returns documents
that contain these words in the same sentence.
Chang <IN> author searches document zones
named author for the word Chang.
"Zone
searches" on page 522.
520

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents