Oracle8i interMedia Text Reference
Release 8.1.5

A67843-01

Library

Product

Contents

Index

Prev Next

5
Special Characters in Queries

This chapter describes the special characters that can be used in Text queries. In addition, it provides a list of the words and characters that interMedia Text treats as reserved words and characters.

The following topics are covered in this chapter:

Wildcard Characters

Wildcard characters can be used in query expressions to expand word searches into pattern searches. The wildcard characters are:

Wildcard Character   Description  

%  

The percent wildcard specifies that any characters can appear in multiple positions represented by the wildcard.  

_  

The underscore wildcard specifies a single position in which any character can occur.  

For example, the following query expression finds all terms beginning with the pattern scal:

'scal%'

To find words such as king, wing or sing, you can write your query as follows:

'_ing'


Note:

When a wildcard expression translates to a stopword, the stopword is not included in the query and not highlighted by CTX_DOC.HIGHLIGHT or CTX_DOC.MARKUP.  


Grouping Characters

The grouping characters control operator precedence by grouping query terms and operators in a query expression. The grouping characters are:

Grouping Character   Description  

( )  

The parentheses characters serve to group terms and operators found between the characters  

[ ]  

The bracket characters serve to group terms and operators found between the characters; however, they prevent penetrations for the expansion operators (fuzzy, soundex, stem).  

The beginning of a group of terms and operators is indicated by an open character from one of the sets of grouping characters. The ending of a group is indicated by the occurrence of the appropriate close character for the open character that started the group. Between the two characters, other groups may occur.

For example, the open parenthesis indicates the beginning of a group. The first close parenthesis encountered is the end of the group. Any open parentheses encountered before the close parenthesis indicate nested groups.

Escape Characters

To query on words or symbols that have special meaning to query expressions such as and & or| accum, you must escape them. There are two ways to escape characters in a query expression:

Escape Character   Description  

{}  

Use braces to escape a string of characters or symbols. Everything within a set of braces in considered part of the escape sequence.

When you use braces to escape a single character, the escaped character becomes a separate token in the query.  

\  

Use the backslash character to escape a single character or symbol. Only the character immediately following the backslash is escaped.  

In the following examples, an escape sequence is necessary because each expression contains a Text operator or reserved symbol:

'AT\&T'
'{AT&T}'

'high\-voltage'
'{high-voltage}'


Note:

If you use braces to escape an individual character within a word, the character is escaped, but the word is broken into three tokens.

For example, a query written as high{-}voltage searches for high - voltage, with the space on either side of the hyphen.  


Querying Escape Characters

The open brace { signals the beginning of the escape sequence, and the closed brace } indicates the end of the sequence. Everything between the opening brace and the closing brace is part of the escaped query expression (including any open brace characters). To include the close brace character in an escaped query expression, use }}.

To escape the backslash escape character, use \\.

Reserved Words and Characters

The following table lists the iMT reserved words and characters that must be escaped when you want to search them in CONTAINS queries:

Reserved Word   Reserved Character   Operator  

ABOUT  

(non)  

ABOUT  

ACCUM  

,  

Accumulate  

AND  

&  

And  

BT  

(none)  

Broader Term  

BTG  

(none)  

Broader Term Generic  

BTI  

(none)  

Broader Term Instance  

BTP  

(none)  

Broader Term Partitive  

(none)  

?  

fuzzy  

(none)  

{ }  

escape characters (multiple)  

(none)  

\  

escape character (single)  

(none)  

( )  

grouping characters  

(none)  

[ ]  

grouping characters  

MINUS  

-  

MINUS  

NEAR  

;  

NEAR  

NOT  

~  

NOT  

NT  

(none)  

Narrower Term  

NTG  

(none)  

Narrower Term Generic  

NTI  

(none)  

Narrower Term Instance  

NTP  

(none)  

Narrower Term Partitive  

OR  

|  

OR  

PT  

(none)  

Preferred Term  

RT  

(none)  

Related Term  

(none)  

$  

stem  

(none)  

!  

soundex  

SQE  

(none)  

Stored Query Expression  

SYN  

(none)  

Synonym  

(none)  

>  

threshold  

TR  

(none)  

Translation Term  

TRSYN  

(none)  

Translation Term Synonym  

TT  

(none)  

Top Term  

(none)  

*  

weight  

(none)  

%  

wildcard character (multiple)  

(none)  

_  

wildcard character (single)  

WITHIN  

(none)  

WITHIN  




Prev

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index