Woodstock, that was a tad naughty of your young plod. He was either stopping you to bollock you for riding on the pavement OR stopping you of suspicion of something which he should ordinarily declare prior to his search of you. ie "Good evening sir, we've had a report of a burglary and the burglar has made his getaway on a bike similar to the one you are riding. Do you mind if I search you to eliminate you from our enquiries"
Check PACE, every copper should know it and if they contravene it THEY ARE COMMITING AN OFFENCE which is reportable. Like I have said the law works both ways, it protects society and it protects you from over zealous and un-educated civil servants.
Part 1 of the Police and Criminal Evidence Act 1984 (PACE) empowers any constable acting with reasonable grounds for suspicion to stop, detain and search you or your vehicle, or anything in or on your vehicle for certain items, which may be seized. The provisions of the Act are supplemented by a Code of Practice on stop and search. The contents of the Code must be observed by the police, although the remedy for failure to observe it is usually to make a police complaint - or if prosecuted to raise an objection in court - rather than to take legal proceedings against the police.
PACE also provides some safeguards for other well-used police powers of search. These might relate, for instance, to searches for drugs or firearms and so on. The safeguards also apply in a limited way to controversial powers of stop and search introduced by the Criminal Justice and Public Order Act 1994 when it is feared that an incident involving serious violence may take place.
The police do not have general powers, apart from those specified in a statute, to stop and search you, unless you consent. You should ask the police officer to explain on what basis they are searching you. If no search power exists you should be told that you do not have to consent and if you do not, you should not be searched.
Relevant Links
Links to the Criminal Justice and Public Order Act 1994 on the HMSO website:
www.legislation.hmso.gov.uk/acts/acts1994/Ukpga_19940033_en_1.htm