Complex Search – Nesting and Parentheses

Complex Search

A complex search is a search that includes one or more Boolean operators, and may or may not require the use of parentheses marks to nest together terms to be processed by the search engine first.

Complex Search with Nesting Parentheses Marks

Nesting words and phrases is helpful whenever you have a complex search that has more than one logical interpretation, or contains more than one Boolean Operator.  The use of parentheses tells the search engine to do the instruction inside the parenthesis marks first, then do the remaining parts of the search expression.

Here is an example of why we need to use parenthesis marks.  Suppose the user typed in the search expression holiday and pay or Christmas and overtime.  Without parentheses in place, Microsearch might look at the search as if there were parentheses as follows: holiday and (pay or Christmas) and overtime. Logically, this instruction is to find all documents with holiday and overtime and either of the two words, pay or Christmas.

If you instead put in the parentheses to force Microsearch to understand what you meant to say, you might put them into the expression as follows: (holiday and pay) or (Christmas and overtime).  In this search expression, holiday and pay must be in the same document, and Christmas and overtime must be in the same document.  Logically, this search expression would find all documents containing either sets of words.

Remove Boolean operator status of near, or, and, not

Sometimes you want to search for a word or phrase that includes a word that is a Boolean expression, but you don’t want the word used that way.

The convention that the search engine uses to remove the Boolean usage is to put the Boolean expression within quotation marks.

For instance, in the search expression holiday or weekend, the search engine  will return all documents that contain either the word holiday, or the word weekend.  But if you really want to retrieve documents containing the precise phrase holiday or weekend, you would remove the Boolean interpretation of the word or by placing it in quotation marks, and instead put in the search expression holiday “or” weekend. The search expression holiday “or” weekend would return all documents containing the precise phrase holiday or weekend.

As another example, suppose you wanted to find all documents that contain the phrase, to be or not to be.  This phrase contains two Boolean operators, or and not. Logically, the search engine will first find all the documents that contain the two words to be.  And because the second instance of the phrase to be is preceded by the Boolean operator not, the search engine would then find all the documents that do not contain the phrase to be.  In short, the search engine would return every document in the database.

If you really wanted to find the document with the precise phrase, the correct search expression is: to be “or” “not” to be. In this case, both Boolean operators have been cancelled by the quotation marks.

Have an interesting search expression you have created to  one of the document databases you can access? Send it along to let us marvel at your creativity.