update document scoring function