The easiest way to do this would require a closed source (or at least partailly closed) client. Basically they client would be able to decript the files but would not permit the decreption of the files stored in the shared/encypted directory.
Because the client would be able to decript the files it could do many things, such as creat an encrypted list of files hosted and the meta data. Searches would then be able so proceed as normal but the client would have to look at the encrypted list of files.
It is all very possible and very doable but the more I look at the great work going on over at
www.freenetproject.org the less use I see in this. Freenet just needs to come up with a method for searching. If you havent looked into it you really should. Its not only the future of file sharing but of the NET!