Skip to content

๐ŸŽค Demo code for my talk called "Shaping Elasticsearch for Recommendation System".

Notifications You must be signed in to change notification settings

jardabezdek/talk-es-for-reco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ talk-es-for-reco

Demo code for the following talk: "Shaping Elasticsearch for Recommendation System"

๐Ÿ“ Authors

๐Ÿ‘ทโ€โ™‚๏ธ Setup

๐Ÿ”ง Local development

In order to create a working environment, the docker is used. To start it, please, follow the next steps.

  1. Launch the docker daemon.
  2. Get to the repository root folder: cd ~/projects/talk-es-for-reco/
  3. Run the docker containers: docker compose up
  4. In another terminal instance, run docker ps, and check that both containers are running:
    1. container-python
    2. container-elasticsearch
  5. In another terminal instance, get into the container with python environment: docker exec -it container-python /bin/bash
  6. Inside the container, run python scripts like this: python <path/to/script.py>

๐Ÿ’พ Elasticsearch

In order to set up Elasticsearch indices and upload data into the corresponding indices, run the following command in the container with python environment: python /usr/src/app/scripts/setup.py

๐ŸŽ‰ Features

In the repository, two features are introduced: search and recommendation.

1๏ธโƒฃ Search

The search.py script utilizes the Elasticsearch library to search the 'users' index based on the provided search input.

Usage:

  1. Modify the SEARCH_INPUT variable to specify the search term.
  2. Run the script: python /usr/src/app/scripts/search.py The search results will be printed to the console.

2๏ธโƒฃ Recommendation

The recommendation.py script utilizes the Elasticsearch to recommend posts to a user based on various factors. It applies a scoring mechanism to rank posts and provide personalized recommendations to the user.

Usage:

  1. Modify the USER_ID variable to specify the user for whom posts should be recommended.
  2. Run the script: python /usr/src/app/scripts/recommendation.py The recommended posts will be printed to the console, sorted from the most relevant to the least relevant one.

๐Ÿ”— Links

About

๐ŸŽค Demo code for my talk called "Shaping Elasticsearch for Recommendation System".

Resources

Stars

Watchers

Forks