It depends on the reason for the discharge. If your case was discharged because the victim did not want to pursue charges that will prevent you from getting a factual innocence determination under PC 851.8. Likewise if the reason was "unable to met the standard of proof" you will likely not be able to set aside the arrest. Both discharges do not imply you are innocent but that some impediment to prosecution caused the discharge.
If you have already consulted with me regarding your case, you need search no further. Your arrest will not be set aside.
I agree with the above. At the hearing on the motion, the court will likely require you to present evidence to prove you are in fact innocent and that the case was not "discharged" for witness unavailability or some other reason. You carry the burden of proof.
A Petition for Factual Innocence is by no means easy to get. And it certainly does require a credible claim of innocence. I agree with Mr. Kaman that the inability to prosecute is not the same as factual innocence; however, to the extent that Mr. Kaman's answer can be read to suggest that the merits depend on the prosecutor's reasons for not pursuing the case, I must disagree with (don't get mad John). The fact that the prosecutor declined to prosecute because there was unwilling witness or insufficient evidence is not the end of the analysis. If you have credible evidence of innocence, you should at least pitch your case to a few lawyers. It may be that they will conclude there is not enough to support a claim of factual innocence. Or they may believe its worth a shot. Good luck to you.