Newer Versions

[2.1]
v2.0
v1.8

Older Versions

v1.6
v1.5

LucidWorks Enterprise v1.7

Other Resources

Support Forums

This is the documentation for LucidWorks Enterprise v1.7. The latest version is [2.6].

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

"John Doe"~2 matches "John Doe" and "Doe, John", as well as "John Q. Doe"

Advanced Proximity Operators

The Lucid query parser also supports advanced proximity query operators to specify more elaborate sequences of terms and to control the order of terms and how many intervening terms are permitted. The advanced proximity operator keywords are:

...

These operators are case insensitive and may be upper, lower, or mixed case, unless the opUp configuration setting is set to "true", which would then treat them (and all other operator keywords) as normal terms unless they are entirely upper case.

Excluding Terms from Advanced Proximity Queries

Normally, any combination of terms may appear between the terms that mark the start and end of an advanced proximity query (the BEFORE, AFTER, and NEAR operators), but in some situations it is desirable to prevent specific terms from occurring between those start and end terms. Just as with a simple keyword query, this exclusion can be done by listing terms preceded by the minus sign '-' or NOT operator. The NOT operator, if used, must be enclosed in parentheses '( )'.

For example, these pairs of queries are equivalent:

George NEAR Washington -person
George NEAR Washington (NOT person)

George NEAR Lincoln -person
George NEAR Lincoln (NOT person)

Also, the exclusions may be specified on either side of the proximity operator, so the following queries are equivalent:

George NEAR Lincoln -person
George -person NEAR Lincoln
George NEAR Lincoln (NOT person)
George (NOT person) NEAR Lincoln

Anchor
lucidparser.proximity.distance
lucidparser.proximity.distance

Controlling Distance Between Terms

By default, the distance between the two terms of a proximity operator can be up to 15 additional terms. That default distance is controlled by the nearSlop configuration setting. But if you need more or fewer intervening terms for a specific proximity operator, you can specify the desired limit of intervening terms by writing a colon (":") and the number immediately after the operator name. For example,

...

Anchor
lucidparser.proximity.longsequences
lucidparser.proximity.longsequences

Composing Longer Sequences of Terms

The advanced proximity operators can be composed (or "daisy-chained") to match more complex term sequences. For example:

...

Anchor
lucidparser.proximity.evalorder
lucidparser.proximity.evalorder

Left to Right Evaluation Order

When multiple advanced proximity operators are composed, they are evaluated left to right, except as parentheses are used to explicitly specify the evaluation order. So, the previous example is evaluated as:

...

Anchor
lucidparser.proximity.quotedphrases
lucidparser.proximity.quotedphrases

Quoted Phrases

Quoted phrases with any number of terms can be used as the operands of the proximity operators. For example,

...

Anchor
lucidparser.proximity.quotedproxphrases
lucidparser.proximity.quotedproxphrases

Quoted Proximity Phrases

Quoted phrases may specify a maximum number of terms that may appear between the terms of the phrase, using the usual quoted phrase proximity query notation of a tilde ("~") and the number of terms permitted. For example,

...

Info
titleNote

Unlike normal quoted proximity phrases, the phrase terms are expected to occur in order. So, this example will not match "development proposal...project".

Anchor
lucidparser.proximity.alternative
lucidparser.proximity.alternative

Alternative Terms

When several different terms are permitted at a position in a proximity sequence, the alternative terms can be specified using the OR operator and parentheses for either or both terms of the operator. For example,

...

Alternatives can also be quoted phrases. For example, ("In the beginning" or "At the start" or "Starting out") before:1000 "the end" will match documents containing the phrase "the end" preceded by either the phrase "In the beginning", "At the start", or "Starting out" with up to 1,000 intervening terms.

Anchor
lucidparser.proximity.termlists
lucidparser.proximity.termlists

Term Lists

A phrase that is not enclosed within quotes is known as a term list and may be used as either of the operands of a proximity operator, where it will be treated as if it were a quoted phrase. For example,

...

Anchor
lucidparser.proximity.parenthesized.termlists
lucidparser.proximity.parenthesized.termlists

Parenthesized Proximity Expressions in Term Lists

Although term lists with proximity operators may seem like a mere convenience to avoid typing the quotes around a phrase, the construct is much more powerful. Each of the terms in a proximity term list can be one of:

...

Anchor
lucidparser.proximity.singlefield
lucidparser.proximity.singlefield

Single Field

Although field names can be used for terms within a proximity expression, only the first field name is used and the others are ignored since an entire proximity expression is evaluated within only a single field.

...