In Massachusetts where I live, here are the general guidelines:
In re G.L. c. 268, § 32B(b).
A person can be charged with resisting arrest only when the officer is acting under the color of his official position (meaning he is on duty and acting according to those duties).
The Commonwealth must also prove that the defendant knew that the
person seeking to make the arrest was a “police officer.” The
Commonwealth may do so by proving that the officer was in uniform or, if
not in uniform, identified himself (herself) by exhibiting his (her)
credentials as a police officer while attempting to make the arrest.
Such credentials would include such things as a badge, insignia,
identification card, police radio, or other police equipment such as a
clearly identified police vehicle.
Thus, in Massachusetts according to usual legal interpretation:
(1) The officer must be on duty and acting in an official capacity.
(2) The officer must be provably known to be a police officer by some means to the person charged.
Resisting arrest must be ancillary to some other charge. You cannot just be charged with "resisting arrest" unless you are actually being arrested on some other charge (or interfering with someone else being arrested). So, as far as a search is concerned, even if the resisting arrest charge were thrown out, the real question would be why was the person being arrested in the first place? That would determine the admitability of the evidence.