# Boolean Operators in Google Custom Search

Given the search terms x,y,z, I want to construct a search query that returns

``````x AND (y OR z)
``````

i.e. documents that do contain x and at least one of y and z (or both y and z). Now according to the documentation, I can use the following query

``````q=x&hq=y+OR+z
``````

Now I am wondering if this returns what I want or rather

``````(x AND y) OR z
``````

I found no way to test that. Any hint (also on how to test it) is very appreciated!

``````q=x&hq=y+OR+z
``````

try

``````q=y+OR+z&hq=x
``````

# Explanation

• `q` It's required.

The search expression.

• `hq`

Appends the specified query terms to the query, as if they were combined with a logical AND operator.

• Thanks for looking at the question. The problem is, I may have to query terms like "(x OR y) AND (z OR a)" so I still need to know how the parentheses are set. – Karsten W. Dec 7 '16 at 9:05
• Even your answer did not really help, I award the bounty to you. – Karsten W. Dec 13 '16 at 14:14