When I found out that Google does not recognize parentheses, I was perplexed! I immediately had a flood of questions about syntax. I posed a question on LinkedIn concerning the topic. How does Google see the search: a b | x y?

Unfortunately, according to my poll results,  it appears that many of the participants  do not completely understand Google’s syntax either!

So how DOES Google view a b | x y? Is the string split in half by the OR symbol?

Google does not determine whether to OR or AND first. It simply reads the string.

a

b | x

y

So our desired results with this stringwould be:

aby

axy

That being the case, how could you produce results that present (a b) OR (x y)?

Attempt to get a results of
ab
xy
and NOT
abxy
aby
axy

A couple of suggestions were made in reference to the poll in the Boolean Strings group on LinkedIn:

“a * * * * * * b” | “x * * * * * y”

Theory: Quotations group the variables, asterisks allow for plenty of space between variables. However, this does bring up an issue of order of the variables. a and x will come before their counterparts in the search. If the b or y come first, it may not pick up.

x/y | a/b

Theory: Placing the / in place of a space will link the variables. It was pointed out that this gets the same results as “x y” | ” a b”. This is very limited.

Essentially, parentheses help us group our strings. Google ignores them, but the string still works since what is left after the parentheses are taken away is a string in a format that Google recognizes.

Let’s look at a string that has parentheses:

(site:linkedin.com/in | site:linkedin.com/pub) (xml | html | uml) (programmer | developer)

We are grouping by site, skill, title. This still works when the parentheses are removed.

site:linkedin.com/in | site:linkedin.com/pub xml | html | uml programmer | developer

The OR operator checks what is to the left and right of the operator. If there is a space, an AND is recognized and that is where the chain is broken. The results above are in the same order and appear to be the same with one exception. The string with the parentheses actually returned less results. I have yet to determine the underlying issue here.

Writing strings without the parentheses can be somewhat confusing at first, but I absolutely prefer it at this point. Thus far, I have not seen how including parentheses in your string hinders it in any way.  The most important aspect is that you keep your grouping correct, with or without the parentheses!

Happy Hunting!

About these ads