In a traditional file search mechanism, such as "flooding," a peer broadcasts a query to its neighbors through an unstructured Peer-to-Peer (P2P) network until the Time-To-Live (TTL) decreases to zero. A major disadvantage of flooding is that, in a large-scale network, this blind-choice strategy usually incurs an enormous traffic overhead. In this paper, we propose a method, called the Statistical Matrix Form (SMF), which improves the flooding mechanism by selecting neighbors according to their capabilities. The SMF measures the following peer characteristics: the number of shared files, the content quality, the query service, and the transmission distance between neighbors. Based on these measurements, appropriate peers can be selected and thereby reduce the traffic overhead significantly. Our experimental results demonstrate that the SMF is effective and efficient. For example, compared with the flooding search mechanism in dynamic unstructured P2P networks, the SMF reduces the traffic overhead by more than 80 percent. Moreover, it achieves a good success rate and shorter response times.