Skip to main content
Skip table of contents

Proximity Searching Options

One of the most popular features to pinpoint results when searching for keywords is the Proximity search. This is a keyword criteria function that allows a choice where two or more words must all be present in a document but cannot be more than a set distance apart.

The proximity feature is particularly helpful for returning results where specific keywords can be found close to one another, regardless of order.   For example, if you wanted to locate a name such as "Jane Beth Doe", instead of having separate entries for "Jane Doe",  "Jane B. Doe", "Jane Beth Doe", "Doe, Jane" etc. you can used proximity searching to limit your keyword to one phrase:   Jane NEAR Doe .

Syntax

The standard syntax for proximity searching is:  KeywordA NEAR(#) KeywordB.

  • NEAR is the reserved word delineates which word or phase will be tied

  • # details a certain distance of the words. For example, bank NEAR(6) money  will find bank if it is within six words of money.

    • The number for the distance between words is limited to 99.

    • If a number is not used, the value is defaulted to 3, so bank NEAR(3) money  can also be written as bank NEAR money .

Complex Proximity

The Proximity operator is very flexible allowing you to group words, chain them together or be precise about direction.

Grouped Proximity

When finding multiple words near a base words, it is more efficient to group them. The keywords in the group must be delineated using curly brackets, i.e.{ and }. For example:

 KeywordZ NEAR(#) {KeywordB OR KeywordC OR KeywordD} Any of the words B, C or D can be found within the # of KeywordZ to match.

{KeywordA OR KeywordB OR KeywordC} NEAR(#) {KeywordX OR KeywordY OR KeywordZ}  Any words on the right side are found near any of the words on the left side of the proximity expression.

Note The use of standard parenthesis with grouping in proximity will cause a syntax error.

Multiple ‘chained’ Proximity Expressions

NEARS can be combined to form a set either singly or grouped:

  •  KeywordA NEAR(#) KeywordB NEAR(#) KeywordC

  • {KeywordA OR KeywordB} NEAR(#) KeywordC NEAR(#) {KeywordX OR KeywordY}

Directional Proximity Searches (BEFORE, AFTER)

Discovery Attender supports using directional indicators in proximity.  The syntax is

  • KeywordA NEAR(#, BEFORE) KeywordB,

  • KeywordA NEAR(#, AFTER) KeywordB.

Note: The syntax can also be shortened using just the first letter, e.g.

  • KeywordA NEAR(#, B) KeywordB 

  • KeywordA NEAR(#, A) KeywordB

Proximity Hints and Tips

  • Unlike the Boolean operators (AND, OR, NOT), the NEAR reserved word can be used in either a Keyword List or in a Search Expression.

  • Multi-Word phrases are valid within Proximity expressions, but quotes must be used: 
    "A Connecticut Yankee in King Arthur's Court" NEAR "To Be or Not to Be"

    • Note: If you are using a wildcard with double quotes, always use the LIKE operator: LIKE(“stock market*” )NEAR(5) advi*

  • Pattern matching (including standard wildcards) can be used in proximity expressions: Adventure* NEAR Sawyer

  • Using another proximity expression within the grouped brackets is not permitted. If needed, these usually can be re-written using other proximity options. For example, {train OR air NEAR plane OR boat} NEAR travel will throw an error. This is better written as two proximity expressions.

  • When using a grouped proximity expression in a keyword list, the Boolean operators must match the type of list.  You can only use 'OR' when in an 'ANY' list.  'AND' can only be used in a "ALL' list.

  • Discovery Attender does not support syntax to find words within a Paragraph or Sentence. Instead, we recommend choosing an appropriate number of keywords and using the Proximity operator (e.g. 20 for sentence, 90 for a paragraph)

Please don’t hesitate to contact support@gimmal.com with any questions.

First published April, 2025

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.