It is demonstrated how to provide a peer-to-peer system that supports an expressive query language while maintaining efficient distribution over a wide-area network. The key is to base message routing on the contents of the query messages and to use advertisements from resource providers to make that routing efficient. Advertisements are special queries that describe the data sets available at each site. Queries are encoded as messages that are efficiently distributed to sites providing advertisements Distribution is determined by symbolically intersecting queries and advertisements. Performance measurements indicate that cost of symbolic intersection is low.