A Survey of Retrieval Algorithms in Ad and Content Recommendation Systems