One could reasonably assume that they developed probable cause to perform the search. If not, then the search wouldn't hold up in court. Developing reasonable articulable suspicion that a crime has occurred or is about to occur to detain a person, who caused another person to be fearful, isn't all that difficult.
FTFY. While the 4th has been all but gutted, the popo still have to at least act like they are following the law.
He wrote, "However his actions when they arrived and the subsequent search of his person after detainment and arrest revealing the white powdery substance"
He said they found the white powdery substance after they arrested him. Maybe he's just getting the timing wrong.