better handling of "OR" in the frequency query automatic query generator