With the advent of the Internet, online resources are increasingly available. Many users choose popular search engines to perform an online search to satisfy their information need. However, these search engines tend to turn up many non-relevant documents, which make their retrieval precision very low. How to find appropriate ranking metrics to retrieve more relevant documents and fewer non-relevant documents for users remains a big challenge to the information retrieval community. In this paper, we propose a new framework that combines the merits of genetic programming and relevance feedback techniques to automatically generate and refine the matching functions used for document ranking. This approach overcomes the shortcoming of traditional ranking algorithms using a fixed ranking strategy. It also gives some new ideas and hints for information retrieval professionals.