import operator


def ranking(query_result):
    """
    Sort the query result vector based on the score of each document in the query_result.
    :param query_result: list of documents that is a result of a query
    :return: The query_result vector ordered by the score of each document
    """
    return sorted(query_result.items(), key=operator.itemgetter(1), reverse=True)