banner4.jpg


Proximity Operators

Proximity Operators allow you to specify searches where one word is near, next to, or in the vicinity of another word.  The three proximity operators defined are:

  • Adj: The adj proximity operator specifies that one word is adjacent to another in a document

  • before/#: The before/# proximity operator specifies that the first word is within # words and before the second word

  • near/#: The near/# proximity operator specifies that the first word is within # words of the second word

Procedure

The procedure for designing and executing a search query with operators is as follows:

 

Step 1. Decide what words you want to search for in your query.

Step 2. Determine how close the two words are that you want the search engine to search for and use the appropriate proximity operator and number of words if applicable.

Step 3. Click on the Search button to execute your search and return a Search Result page.

Examples

Query

Retrieves

Notes

congressional adj hearing

Documents with the word "congressional" directly followed by the word "hearing"

 

representative near/10 cardin

Documents with the word "representative" within 10 words of the word "cardin"

 

representative near cardin

Documents with words "cardin", "near", and "representative" anywhere inside the document

The term "near" is only an operator when it has the /# as the suffix otherwise it is treated just like a regular word.

representative before/10 cardin

Documents with the word "representative" within 10 words and before the word "cardin"

 

representative before cardin

Documents with words "cardin", "before", and "representative" anywhere inside the document

The term "before" is only an operator when it has the /# as the suffix otherwise it is treated just like a regular word.

(Bill and Clinton) before/100 (Hillary and Clinton)

No documents retrieved

This will return an "unsupported proximity operator" error. The "and" operator (implied or otherwise) can not be nested within a proximity operator.

(Bill adj Clinton) before/100 (Hillary adj Clinton)

Documents with the name “Bill Clinton” within 100 words of the name “Hillary Clinton”

A successful version of the above query. Note that all operators within a proximity expression must themselves be proximity operators.

not Bill before/100 Clinton

No documents retrieved

Will also return an "unsupported proximity operator" error. The "not" operator is not allowed to be within a proximity expression.

 

Note: Because a proximity expression is trying to find words (or phrases with quotes) that are located within a specified proximity of each other, using Boolean operators or multiple words without quotes in a proximity expression will result in a search query error. One way to make sure that you do not get search query errors is to always use parentheses around the proximity expression when creating search queries that use proximity operators.

 

Examples of proximity expressions using quotes:

  • environment not (“Bill Clinton” before/100 “Hillary Clinton”)

  • environment (Clinton near/10 Bush)

 

 


G P O ' S   F E D E R A L   D I G I T A L   S Y S T E M