Change condition order in search logic.