You may be under the impression that a police officer may search you because he or she believes you've done something wrong, but the reality is that the Fourth Amendment to the Constitution protects you against illegal searches and seizures. To get a warrant that gives the officer a right to search you, your vehicle or your property, there must be probable cause.
You are protected against unreasonable searches and seizures. What that means is that while in most cases the police do need a warrant, not all cases require one. For example, if you're caught smoking marijuana outside, the officer may legally search you for additional drugs. It is reasonable that he or she would think to search you for drugs since you're openly using them.
Another scenario that could lead to a legal search would be if you were driving erratically and have a baggie of a white substance on your front seat. There is no expectation of privacy, because the officer can clearly see the baggie from the window. Additionally, your behavior would give the officer a legal reason to pull you over and to be looking into your vehicle.
In most cases, officers still take the time to get a warrant before they search a person or a person's property. Why? It's simple: They don't want any evidence they collect to be inadmissible in court.
Our site has more on what you can do if you're unreasonably searched. Your rights are protected by the Constitution. Stand up for yourself and know that you can defend yourself.