How to build recommendation system using ElasticSearch


At that article we are going to speak about Recommendation Systems. And we will start from theory as always. So what does it mean at all? Recommendation System (RS) – is a subclass of information filtering system that seeks to predict the “rating” or “preference” a user would give to an item. Recommender systems are used in a variety of areas. Examples:

  • playlist generators for video and music services. Suppose that almost everybody knows what is Netflix today
  • product recommenders for online stores (Amazon use it’s RS widely to propose you some products)
  • content recommenders for social media platforms, as you can Facebook is using different RS algorithms to recommend you some content that you would like

Generally all Recommendation Systems can be divided into 2 big groups: Collaborative filtering, Content-based filtering. What does it mean I describe in the video below within that article or you may go even more deeper at view my whole online course at udemy using next link with discount: link to udemy.

Today’s last trend is building hybrid RS systems that try to combine collaborative and content based system at the same time trying to minimize theirs disadvantages. Despite RS are rather popular there are some interesting things around it:

  • there is still not a lot of information about how to realize such a system
  • such systems are very computationally intensive
  • such systems are very complex for understanding and debugging

Why? Let’s have a look at typical solution

I am describing more deeply current slides at video below. But it should be clear at first glance that you should be very good at:

  • math, especially at linear algebra course, SVD (singular value decomposition)
  • optimization algorithms, and here is where ML comes

Can IT be doNe more simple?

Yes, as classical solutions are not always good for some specialized area. As you can guess mine solution would be based at ElasticSearch 🙂 I am going to prove to you that we are able to build RS in a rather fast way. And that solution would be rather clear for understanding and debugging.

Related articles you can be interested on: “How to build advanced search system using ElasticSearch

About the author


Software engineer with over 18 year’s experience. Everyday stack: PHP, Python, Java, Javascript, Symfony, Flask, Spring, Vue, Docker, AWS Cloud, Machine Learning, Ansible, Terraform, Jenkins, MariaDB, MySQL, Mongo, Redis, ElasticSeach

architecture AWS cluster cyber-security devops devops-basics docker elasticsearch flask geo high availability java machine learning opensearch php programming languages python recommendation systems search systems spring boot symfony