Criminal Law Questions? Ask a Criminal Lawyer.
If the state's case rests upon the evidence from that search, and the court determines that the search was illegal, and suppreses the evidence, the state will very likely dismiss the charges.
If there are some problems with the search, but they're not necessarily fatal, to remove risk, the prosecutor will be more willing to offer a deal.
Thanks for your questions.