This paper presents SemAnt, a distributed content-based routing algorithm based on the Ant Colony Optimization meta-heuristic and adapted for deployment in peer-to-peer networks. Under the assumption that the shared content in the network is annotated according to a taxonomy, it is possible to determine the hierarchical relationships between queries, and to exploit this information to improve the routing process. The experimental results presented in this paper show that the performance of content-based peer-to-peer search is highly dependent on the content distribution in the network and on the network’s topology. It can be improved by exploiting the information provided by the underlying taxonomy. The degree of improvement is proportional to the degree of coherence in the content distribution.