Processing Complex Similarity Queries in Peer-to-Peer Networks