Keyword Query Language Syntax

Use the keyword query language syntax (KQARL) in either upper- or lowercase.

  • For example, type AND or and.

  • Specify document properties for fields within the document such as:

    • author, title, body, and so on.

For example:

  • filetype:docx: matches documents with the file type docx
  • title:REGEX([0-4]): matches document with 0, 1, 2, 3, or 4 in the title.

You can also use the AND, OR, NOT, NEAR, and ONEAR operators with these properties within the input document.

For example:

  • title:"2029 L.P" or title:2030:

    • Matches documents with 2029 L.P, "2030", or “2029 L.P 2030” in the title

  • title:"2029 L.P" and title:2030:

    • Do not match documents with "2029 L.P" or "2030" in the title, but do match documents with “2029 L.P 2030” in the title.

To specify the properties within a document, use any of the following syntax specifications:

Field:"FieldValue"

Field:FieldValue

field:"FieldValue"

field:FieldValue

To see the following example, go to the Manage Taxonomies page, download and open your taxonomy in Notepad:

See an example of the General Business taxonomy in Notepad.

Keyword Query Language Syntax Operators

KQLAR

Before you write a rule using KQLAR syntax, make sure that the TermRuleLanguage property is assigned to KQLAR.

KQLAR queries are case-insensitive, but the operators are case-sensitive (uppercase).

See the following sections to learn more about these operators and their properties:

AND

Matches a string that includes all of the specified terms.
For example:

cat and cat2 and (dog1 and (dog2 and dog3)) and fox1 and fox2

Matches cat cat2 dog1 dog2 dog3 fox1 fox2.

You can substitute a plus sign (+) for the AND operator.

OR

Matches strings that contain any of the terms. For example:

cat and cat2 and (dog1 or (dog2 or dog3))

Matches cat cat2 dog1, cat cat2 dog2, cat cat2 dog3, cat cat2 dog1 dog2, cat cat2 dog1 dog3, cat cat2 dog2 dog3, or cat cat2 dog1 dog2 dog3.

NOT

Matches input document that do not include a specified term. For example:

cat and cat2 not dog

Matches cat cat2.

You can substitute a dash (-) for the NOT operator.

ALL

Matches documents that include all of the terms.

For example:

all(cat dog fox)

Matches cat dog fox.

ANY

Matches documents that include all or any of terms and all of their combinations.

For example:

any(cat dog fox)

Matches cat dog fox, cat dog, cat fox, dog fox, cat, dog, or fox.

NEAR

Matches input documents where the specified search terms are within close proximity to each other, without preserving the order of the terms.

For example:

cat near(N=3) dog or cat near(3) dog

Matches cat dog, cat fox1 dog, cat fox1 fox2 dog, cat fox1 fox2 fox3 dog, dog cat, dog fox1 cat, dog fox1 fox2 cat, dog fox1 fox2 fox3 cat.

The Wildcard Character: *

Enables prefix matching.

For example:

app*

Matches app, apple, or application.

CASE

The CASE operator matches terms that appear in the specified case in the input document.

  • You must use either the AND or the OR operator, parentheses (()) and quotation marks (""), in a CASE rule.

See the following examples:

CASE("Litigation") OR CASE("lawsuit")

"Litigation" AND CASE("lawsuit")

CASE("Litigation") OR "lawsuit"

SOUNDSLIKE

Specify the SOUNDSLIKE operator for Levenstein distance search. True if the rule sounds similar to the document’s text.

For example:

soundslike("manufactrin")

Matches manufacturing.

NOSTEM()

Use the NOSTEM() operator for an exact word match.

For example:

nostem(app)

Matches app.

REGEX()

Use the REGEX() operator when you want to match a pattern such as an email, URL, or phone number.