The fundamental challenge confronting peer-to-peer (P2P) resource-sharing networks is to provide efficient and scalable search services in a large-scale, open and dynamic environment. However, current search mechanisms are not efficient or scalable enough with the expansion of the systems. To improve search efficiency, this paper proposes the trust-based probabilistic search mechanism, called the Preferential Walk (P-Walk). Every peer adjusts its neighbors' rank continuously according to their performance in previous searches. The basic principle of the P-Walk is that neighbors with higher ranks in the question domain have higher probabilities of being queried. Extensive simulation results show that the P-Walk can significantly improve the success rate of the query and the response time whilst also effectively reducing traffic volume and controlling malicious behavior. Furthermore, we measure the rank distributions of the peers and find their power-law-like trends based on a Gnutella-like network. Implications are drawn from the analysis of the rank distributions. The P-Walk mechanism works effectively in a P2P view model that provides appropriate views of the P2P network for queries of different types. Copyright © 2006 John Wiley & Sons, Ltd.