For pairwise algorithms, a straightforward way is to assign the query weight to all the document pairs associated with this query.
in this case, a small number of documents that were weighted inaccurately can make significant impact on many number of document pairs.