Statistical ranking system for documents based on the query complete