Skip Headers
Oracle® Secure Enterprise Search Administration API Guide
11g Release 2 (11.2.2)

Part Number E23428-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

B Query Syntax

This appendix describes the various ways of specifying search strings for Oracle SES. Text in square brackets represents characters entered into the search.

Single term search

Entering one term finds documents that contain that term.

For example, [Washington] matches all documents that contain the word Washington anywhere in that document.

You can enter any two searchable items (including term, phrase, attribute shortcut, and proximity search) in a query with a white space separating them and the AND operator applies. The [&] operator also explicitly denotes an AND relationship.

For example, [muddy water] and [muddy & water] both return documents containing muddy and water.

Phrase search ["..."]

Put quotes around a set of words to find documents that contain that exact phrase.

Oracle SES does not apply implicit stemming expansion to a query phrase, but it can apply explicit term expansion to terms in a phrase. All operators except term expansion operators in a phrase are treated not as valid operators but as normal special characters.

For example, [metropolitan "dance performance"] returns documents containing metropolitan and the phrase "dance performance". Documents containing the stemming form "dance performances" are not returned. There is no implicit stemming expansion on either term. The query ["sec*re search"] returns documents with the phrase "secure search". The query ["sec^re search"] returns documents with the phrase "sec re search".

Attribute shortcut search [attribute_name:attribute_value]

Search on attributes with an attribute name, a colon (:), and then the value to be searched. Implicit stemming is applied to the attribute value term. You can specify operators as options. When no operator is specified, Oracle SES uses Contains for STRING attributes and Equals for NUMBER and DATE attributes.

For example, [DocVersion:>1] returns documents that have number attribute Docversion with a value larger than 1. The query [title:"oracle text"] returns documents with the phrase "Oracle Text" in the title attribute. The query [oracle | title:S*S] returns documents with the term Oracle or SES in the title attribute. The query [title:^oracle] has the same effect as [title:oracle]. The contains operator [^] applies only to the STRING attribute.

Proximity search ["..."~]

A proximity search specifies the maximum distance within which multiple terms occur. A proximity search must have the search terms in double quotes. When the maximum spanning distance is not specified, Oracle SES applies a default window of 100 terms. The maximum number is 100. Entering a larger value is the same as entering 100. For example, ["ses performance"~10] returns documents with the terms SES and performance within any 10 terms spanning windows. The query ["ses performance"~] returns documents containing the terms SES and performance within any 100 terms spanning windows.Implicit stemming expansion is applied to each term in proximity search. Term expansion operators can be applied to terms in proximity search.

Fuzzy search [...~]

Put the fuzzy operator (~) after a single term to return documents that contain terms similar to the query term. For example, [hallo~] returns documents containing term hello. The query [spacifi*tion~] returns documents containing the term specification.

Note: If a single term enclosed in double quotes is followed by ~, then the query is not a proximity search but a fuzzy search. The query ["parformance"~] returns documents containing the term performance.

Thesaurus-based searches: synonym [~...], narrower term [<], broader term [>]

Thesaurus-based operators require that a thesaurus be loaded into Oracle SES.

Put the ~ operator at the beginning of a term to return documents that contain the original query term or a synonym for it. For example, [title:~"RAC"] returns documents with RAC or the synonym Real Application Clusters in the title. A synonym relationship is symmetric: Real Application Clusters is a synonym of RAC, and RAC is a synonym of Real Application Clusters. In attribute search, it applies only to the STRING attribute.

The query [<"Northern California"] returns documents with the thesaurus-defined narrower term San Francisco or the original phrase Northern California. The query [product:>chair] returns documents whose product attributes contain the broader term furniture or the original term chair. Broader and narrower terms are symmetric. Specifying that furniture is a broader term of chair also implicitly specifies that chair is a narrower term of furniture.

OR [|] search

Use the OR (|) operator to connect any two searchable items.

For example, [metropolitan | "dance performance"~] returns documents with the term metropolitan or with the terms dance and performance in any 100 terms spanning windows. The query [oracle | title:ses] returns documents with the term Oracle or SES in the title attribute.

Grouping ( ) search

Use parentheses () to group query components to change precedence of the binary logical operators AND and OR. The grouped query components must form a valid query. If the query string inside parentheses is not a valid query, then Oracle SES implicitly rewrites it to the closest valid query.

For example, [(oracle | database) sales] returns documents containing sales and containing either Oracle or database. The query [(oracle |) sales] returns documents containing Oracle and sales. This is because [oracle |] is not a valid query.

Wildcard matching [*] for multiple characters

Put the * operator in the middle or end of a term for wildcard matching. It can be applied multiple times in one term.

For example, [ora*] finds documents that contain words beginning with ora, such as Oracle and orator. The query [title:a*e] returns documents with the title containing words such as apple or ape.

Multiple character wildcard expansion could result in too many results. For example, [a*] could find too many results. Oracle SES throws an error to refine the queries.

The wildcard operator [*] is ineffective with the escape character [\] just before it. For example [Pro\*c].

Wildcard matching cannot be used with Chinese or Japanese native characters.

Wildcard matching [?] for single characters

Put the ? operator in middle or end of a term for wildcard matching for a single character. It can be applied multiple times in one term.

For example, both [orac?e] and [or?cl?] return documents containing terms that replace ? with a single character, such as Oracle.

The wildcard operator [?] is ineffective with the escape character [\] just before it.

Wildcard matching cannot be used with Chinese or Japanese native characters.

Compulsory inclusion [+] search

Put the + operator at the beginning of any searchable item (including term, phrase, attribute, and proximity search) to require the word in all matching documents. Do not put a space between the [+] and the search term.

For example, searching for [Oracle +Applications] only matches documents that contain the words Oracle and Applications.

When compulsory inclusion search is used with the OR (|) operator, the compulsory inclusion operator does not have any effect. For example, searching for [text | +database] returns documents containing the term text or database.

Compulsory exclusion [-] search

Put the - operator at the beginning of any searchable item (including term, phrase, attribute, and proximity search) to match only those documents that do not contain the term. It can be a single word or a phrase, but there cannot be a space between the [-] and the term.

For example, [oracle –applications] returns documents that contain Oracle but not applications. The query [oracle –"application server"] returns documents that contain Oracle but not the phrase "application server". The query [oracle –title:oracle] returns documents containing Oracle in the body but not in the title. The query [oracle –"application server"~] returns documents containing Oracle but not containing application and server in any 100 terms spanning window.

The compulsory exclusion query cannot be the only query. For example, the query [-oracle] raises an error. Also, the compulsory exclusion query cannot be connected with the OR [|] operator. For example, [oracle | -database] raises an error.

Filetype search [filetype:filetype]

Use [filetype:filetype] after the search term to limit results to that particular file type. A search can have only one file type. No operator is allowed in file type shortcut search.

For example, [documentation filetype:pdf] returns PDF format documents for the term documentation. The filetype shortcut must be lower case, but the file type name is case-insensitive; that is, [documentation filetype:PDF] returns the same documents.

The following file types are supported, with their corresponding MIME type:

ps: application/postscript
ppt: application/vnd.ms-powerpoint, application/x-mspowerpoint
doc: application/msword
xls: application/vnd.ms-excel, application/x-msexcel, application/ms-excel
txt: text/plain
html: text/html
htm: text/html
pdf: application/pdf
xml: text/xml
rtf: application/rtf

Site search [site:host]

Use [site:host] after the search term to limit results to that particular site.

For example, [site:www.oracle.com filetype:pdf] returns documents from www.oracle.com in PDF format. The site shortcut must be lowercase, but the host name is case-insensitive; that is, [site:www.Oracle.com filetype:pdf] returns the same documents.

Oracle SES only supports exact host matching. The query [site:*.oracle.com] does not work.

Group search [sg:source group]

Use [sg:source group] to limit results to that particular source group. All other search restrictions are valid in a group search.

For example, [sg:intranet] returns documents in the intranet source group. The sg shortcut must be lower case, but the source group name is case-insensitive; that is, [sg:IntraNet] returns the same documents.

In federated searches, the source group names are the source groups in the local (broker) node. If the local source groups contain federated sources, then Oracle SES translates the local source group name to the federated source group name by changing the query, which is then sent to federated source for results.