changed search logic for where sql

now you the order of the query parts do not matter and it is no longer
depend on a plugin setting