Add 'or' logic to query string generator

Change-Id: If2373f60c58065b0616f160189bddb0f1a0fe390