Students do relinquish some privacy rights when going to school, but not of the type that would permit this type of search. I would contact a civil rights attorney in your neighborhood and ask for a free consultation to find out your options for addressing this legally.
Was this a private school or public? And what grade level is your daughter? Before getting into any discussions about taking possible legal action, you should contact the school for a copy of the written rules and regulations about student's cell phones at school. Private schools have a great deal more latitude than public, but most schools, public and private, have existing rules in place pertaining to cell phones brought to school by students. If there was reason for the school to believe that your daughter violated those rules, there may be some rule that the school believes justified the principal's action. It may be more important to defend against any disciplinary action against your daughter than to be considering an aggressive legal action or administrative complaint against the school. In all events, there are no meaningful damages apparent from the info in your question, so I would only caution you that many civil rights attorneys would not be willing to take this case on contingency. Only you can determine whether this matter justifies a lawsuit funded out of your own pocket. In all events, you do not want to mount a case that will not result in a recovery sufficient to cover the considerable costs of suing the school. A consultation with an attorney after you have resolved any disciplinary issues involving your daughter would be useful for you.
My responses to questions on Avvo are never intended as legal advice and must not be relied upon as legal advice. I give legal advice only in the course of an attorney-client relationship. Exchange of information through Avvo's Questions forum does not establish an attorney-client relationship with me. That relationship is established only by individual consultation and execution of a written agreement for legal services.