Skip to content

Text Contains Clauses (OLAP)

JoeWinter edited this page Sep 18, 2014 · 2 revisions

[Table of Contents](https://github.com/dell-oss/Doradus/wiki/OLAP Databases: Table-of-Contents) | Previous | Next
Doradus Query Language: Text Contains Clauses


Text fields can be queried for values that _contain_ specific terms. In contrast, equality clauses (described later) compare the entire field value.

Term Clauses

A term clause searches a specific field for one or more terms. To designate it as a contains clause, the field name must be followed by a colon. Example:

Name:Smith

This clause searches perspective objects' Name field for the term Smith (case-insensitive). To specify multiple terms, enclose them in parentheses. Example:

Name:(John Smith)

To match this clause, an object's Name field must contain both John and Smith, but they can appear in any order and be separated by other terms.

Be sure to enclose multi-term clauses in parentheses! The following query looks like it searches for John and Smith in the Name field:

Name:John Smith // doesn't do what you think!

But, this sequence is actually interpreted as two clauses that are AND-ed together:

Name:John AND *:Smith

Matching objects must have John in the Name field and Smith in any field. In OLAP applications, this query isn't allowed because the second "all fields" clause type is not supported.

Phrase Clauses

A phrase clause is a contains clause that searches for a field for a specific term sequence. Its terms are enclosed in single or double quotes. For example:

Name:"John Sm*th"

This phrase clause searches the Name field for the term John immediately followed by a term that matches the pattern Sm*th. The matching terms may be preceded or followed by other terms, but they must be in the specified order and with no intervening terms. As with term clauses, phrases clauses can use wildcards, and searches are performed without case sensitivity.

Clone this wiki locally