How to implement the efficient query is the key problem deployed on P2P networks. This paper analyses the shortage of several query algorithm, and presents a new algorithm DDI, which means distributed searching with double indices. It discusses the popularity of documents and the linking status of the networks, and calculates the availability of the nodes in whole network, determines the route of the query process. It compares the items of time using, the quantity of requests and update information by the emulate experiments.<p> </p>Along with the rapid development of computer network technology, peer-to-peer (referred to as P2P) network research has gradually become mature, and it is widely used in different fields, some large P2P computing project has entered the implementation stage. At present, many more popular software systems such as Gnutella, Freenet, Napster are deployed based on P2P technology. How to achieve effective information query has become one of the key problems of P2P research.