When handling searches, the overall order to precedence is:
Parentheses [( )]
Why and how using parenthesis improves your search
The parentheses clarify which part of the equation to evaluate first. The same rules apply to boolean queries. Not using parentheses leads to ambiguity in how the query should be interpreted. As a result, our interpretation might not match what you are looking for, leading to inaccurate results.
For example, a common search mistake is the mixing of OR and AND operators without parentheses, or OR and NOT operators without parentheses. Since OR and AND, or OR and NOT have different precedence, it is important to put parentheses to make sure your intent is absolutely clear to the search engine.
Consider the grouping to refine searches::
Parentheses are also useful for combining a bunch of search tasks together and specifying the order.
For example, what if you were monitoring people discussing apple pies and peach pies (plural or singular), but you don’t want to capture any results that mention frozen pies. You can combine a Boolean query to find the two types of fruit combined with plural or singular forms of pie, and then remove any frozen mentions.
((apple OR peach) AND (pie OR pies)) NOT frozen
- Set 1: (apple OR peach) = results containing the words apple or peach
- Set 2: (pie OR pies) = results containing the words pie or pies
- Set 3: ((apple OR peach) AND (pie OR pies)) = results with both sets of words in them (e.g., apple pie, apple pies, apple cobbler pie, peach pie, peach pies, peach homemade pie, frozen apple pies)
- Final set: NOT frozen = results in set 3 and any page that has the word frozen in it is removed.