Extracting Document Relations from Search Corpus by Marginalizing over User Queries