The natural language operators enable you to specify search criteria using natural language syntax. The search engine uses natural language analysis to translate the query text into Verity query language expression for evaluating and scoring documents. The
FREETEXT
and LIKE
natural language operators are intended mainly for use by application developers. FREETEXT
Interprets text using the free text query parser and scores documents using the resulting query expression. All retrieved documents are relevance-ranked. For information about the free text query parser, refer to Appendix A.
style.stp
file(s), the free text query parser uses the stop words for the query, ignoring the stop words list. The
FREETEXT
operator can be combined with other operators in the same way as the ACCRUE
operator.
The
LIKE
operator accepts a single operand, called the QBE (query-by-example) specification. The QBE specification can be either the literal text of the example to query on, or it can be a specification of one or more full documents and text passages to use as positive and negative examples.NOTE: In the case where a query or document contains only words defined as stop words in the collections
style.stp
file(s), a QBE query with the LIKE
operator returns no results.
posex
(positive example), or negex
(negative example).
A negative example reduces the weights of terms when they occur in a positive example. If terms from a negative example do not exist within the positive example, the negative example has no effect. (Hence a
negex
by itself makes no sense.)
VdkVgwKey
, to specify a document by external key
VdkDocId
, to specify a document by internal (session-specific) key,
File
, to specify a file containing the document text
Text
, to specify the text directly
posex
is the implied name).The value of value depends on type:
VdkVgwKey
and VdkDocId
: the document key
File
:
Text
: literal text.
VdkDocId
if it starts with a #
character
VdkVgwKey
for all other cases
Like
operator can be combined with other operators using the same rules as for the ACCRUE
operator.
LIKE
operator allows VdkVgwKeys to be enclosed in quotes (either single or double) to avoid parsing confusion. This means VdkVgwKeys containing things like whitespace, curly braces, and quotes can be handled. Backslash must be used to escape quote characters and backslashes embedded in the key, as is standard for string handling.The syntax supports the use of single quotes for enclosing literal text examples, as in {text:'sample text'}.
The syntax for text: and vdkvgwkey: references has been enhanced to allow the reference value to be enclosed in either single or double quotes, with the usual backslash escaping mechanisms for embedded backslashes and quotes.
Concerning the backslash character in document keys, follow these guidelines. When a backslash appears in a document key, you must enter two backslashes in the <LIKE> syntax. See "VdkVgwKey Fields on Windows Systems" below for important information about specifying paths on Windows systems.
- <LIKE> ( "{text:'sample text'}" )
- <LIKE> ( "{text:"sample text"}" )
- <LIKE> ( "{text:"sample `quote'"}" )
- <LIKE> ( "{text:"sample \"quote\""}" )
- <LIKE> ( "{vdkvgwkey:keyname}" )
- <LIKE> ( "{vdkvgwkey:'{keyname}'}" )
- <LIKE> ( "{vdkvgwkey:"{keyname}"}" )
- <LIKE> ( "{vdkvgwkey:"c:\\my\\data"}" )
- <LIKE> ( "{vdkvgwkey:"c:\\\\my\\\\data"}" )
LIKE
operator.Just literal text:
posex
names:
VgwKey
:
doc.txt
, starting at the 100th byte:
LIKE
expressions must be preceded by backslashes. The backslash indicates to the engine that the following character is supposed to be treated as a literal character.
LIKE
expression, the search engine must analyze the full text of the examples in the QBE specification. This has the potential to be time consuming, especially if the example documents are large or require expensive filtering. The processing of
LIKE
queries can be accelerated by extracting feature vectors for documents at indexing time. Feature vectors are extracted during indexing when an appropriate entry is made in the style.prm
file, as described in the Verity Collection Reference Guide. With feature vectors available in the collection, the search engine does not need to touch the original text of the example documents and LIKE
queries are processed very efficiently.