Representation Learning for Efficient and Effective Similarity Search and Recommendation