Added query logs into weighting scheme