A survey on ranking keyword search results
There is a research literature on this subject that uses machine learning for ranking; it is often known under the term learning to rank.  I recommend reading the papers on that subject.