All that follows may not be applicable in your state; you would be well-advised to consult a lawyer who is familiar with the laws of your state, and familiarize yourself with the applicable laws in your state. I am not a lawyer, and what I have to say here may not be applicable in your state.
In a situation where the police want to search your property, and they have not acquired a warrant to do so ... you may not have a legal obligation to allow them to search your property.
This is what may be known as an Illegal Entry; or it may be a "No-Knock Warrant". in the case where Police are permitted by local laws to enter your property for the purpose of executing a search with or without your permission.
Evidence discovered via a warrantless search, MAY BE defensible in court.
If the searchers discover something which they subsequently present in a court of law as "evidence", it might legally be held against you, regardless of the circumstances .. if you gave permission to allow them the search.
Any arrest based on a warrantless (or otherwise not-legal) search may be defensible. You may not be able to defend yourself in court against an illegal search, if you permit it at the time. Demonstrating that the search was not grounded by a warrant may not be sufficient defense to require the court to ignore the evidence discovered there-in. If you have uttered words which might be considered as "consenting" to the search, any evidence found during the search may be used against you.
I'm not a member of the bar, so you should seek legal counsel if you find yourself in this kind of quandary; but I encourage you to defend yourself against any charges based upon "questionable evidence" discovered during a search which is not specifically named in a legal warrant which purports to justify a search of your home and/or property.
Rule #1: Admit NOTHING. It's better to remain silent, and be considered a fool, than to speak and prove to be a fool.
Rule #2: Never agree to a warrantless search. The first words out of your mouth should be "Show Me Your Warrant". If the would-be searchers cannot present a warrant, the search is not legal. Evidence found in an illegal search may not be used in evidence against you in court ... but don't count on it. Note carefully the conditions and terms of the warrant; it should include the areas to be searched, and the objects for which they are searching. If they are looking for guns, and happen to notice a sword in a closet ... the sword may not be a significant finding, or anything found in the closet may not be subject to confiscation. But if they are looking for "weapons", it may be taken in evidence.
Rule #3: The next words you speak (and the last words) should be: "I need to have my lawyer present before I answer any questions or consent to a search".
Rule #4: Heed Your Lawyer! Nobody else: and certainly do not heed the advice of anyone who has the power to arrest you.
There are defenses: in some states, if you do not consent to a search of your privately owned property, under certain circumstances evidence found may not be admissible in a court of law. Again, you will probably need to present the search warrant (if one is offered) to you attorney to ensure that your rights have not been violated by a too-exuberant exercise of search which are not permitted under the terms of the search warrant.
The terms of a search warrant should include the areas to be searched, and the objects for which the searchers expect to find. Which is not to say that if the searchers are looking for machine guns and the find illicit drugs, they must overlook the drugs, but that confuses the mission and may sometimes obviate their findings. (If the police are looking for machine guns and find an ounce of drugs in a pill-box ... the machine guns could not be expected to be found in a pill-box, and so the finding of a pill-box of drugs may not be the result of a "legal search". But don't count on it!)