changing search query for pg