adding ORs and ANDs to search table