Text this: Beyond Semantic Relevance: Counterfactual Risk Minimization for Robust Retrieval-Augmented Generation