{"id":21232365,"url":"https://github.com/o19s/elastic-graph-recommender","last_synced_at":"2026-03-07T22:32:45.911Z","repository":{"id":138162765,"uuid":"60923334","full_name":"o19s/elastic-graph-recommender","owner":"o19s","description":"Building recommenders with Elastic Graph!","archived":false,"fork":false,"pushed_at":"2020-09-14T13:52:32.000Z","size":101,"stargazers_count":37,"open_issues_count":3,"forks_count":14,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-10-19T01:54:26.138Z","etag":null,"topics":["elasticsearch","movielens","recommender-system","tmdb"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/o19s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-11T19:03:14.000Z","updated_at":"2022-09-20T14:18:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"04768ace-2067-4f05-afab-585e6b12fbf3","html_url":"https://github.com/o19s/elastic-graph-recommender","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/o19s/elastic-graph-recommender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Felastic-graph-recommender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Felastic-graph-recommender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Felastic-graph-recommender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Felastic-graph-recommender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o19s","download_url":"https://codeload.github.com/o19s/elastic-graph-recommender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o19s%2Felastic-graph-recommender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30234662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","movielens","recommender-system","tmdb"],"created_at":"2024-11-20T23:50:37.267Z","updated_at":"2026-03-07T22:32:45.862Z","avatar_url":"https://github.com/o19s.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elastic Graph Recommender\n\n[Blog Post](http://opensourceconnections.com/blog/2016/10/05/elastic-graph-recommendor/) \n\nBuilding recommenders with Elastic Graph! This app makes movie recommendations using Elastic graph based on the Movielens data set. [Movielens](http://grouplens.org/datasets/movielens/) is a well known open data set with user movie ratings.\n\nWe use this data alongside [The Movie Database(TMDB)](https://www.themoviedb.org/?language=en). TMDB has all the movie details such as title, image URL, etc.\n\n## ETL and data prep\n\nIn the etl/ folder there are several Python scripts for importing movielens \u0026 TMDB data into Elasticsearch into two collections.\n\n- One index, `movielens` stores user view data. Each record is a user and the movielens identifiers of movies they liked. The primary key is a movielens user id. These documents hold a single field `liked_movies` -- the movielens ids of the movies this user liked.\n- Another index `ml_tmdb` uses the mapping from movielens ids -\u003e tmdb ids to store details about each movies (title, poster image URL, etc). The primary key is the movielens movie id.\n\n### Import Movielens ratings\n\n- `prepareData.sh` is a shell script for downloading the latest movielens data (ml-20m) and unpacking it to the ml-20m folder.\n- `ratingsToEs.py` is a Python 2.7 script for importing movielens data into Elasticsearch\n\n### Import TMDB movie details\n\nIt's recommended you get the prepared source data file `ml_tmdb.json` from someone. But you can recreate it with the scripts below\n\n- `tmdb.py` crawls the movielens TMDB movies into tmdb.json\n- `rehashTmdbToMl.py` creates ml_tmdb.json, which is tmdb.json with the movielens as the primary identifier\n- `indexMlTmdb.py` indexes ml_tmdb.json into Elasticsearch\n\n## Angular App\n\nThe `app/` folder holds an angular app for querying Elasticsearch via the graph API for recommendations.\n\n### Bootstrap app\n\nSee the `app/depends.sh` shell script for bootstrapping bower and npm dependencies\n\n### Run the app\n\nStart a dumb web server in the app/ dir,\n\n```\ncd app/\n./srv.sh\n```\n\n### Tests\n\nTests are run via Karma, you can run `app/test.sh` to run tests. When debugging, I use the following command:\n\n```\nnode_modules/karma/bin/karma start --no-single-run --log-level debug --auto-watch --browsers Chrome\n```\n\nwhich runs Karma in Chrome, autowatching the source files.\n\n# Deploying\n\n## By rubbing two sticks together to start a fire\n\n- However you like to deploy stuff, there's a script [bootstrap.sh](bootstrap.sh) that lists the steps taken to provision an Ubuntu box with Elastic Graph. NOTE this script is meant for development purposes, it does several non-secure things like opens up Elasticsearch to the world and has very liberal CORS permissions.  \n\n## By using Docker\n\nStart the docker images via:\n\n```\ndocker login harbor.dev.o19s.com   # ask Eric for credentials\n\ndocker run -d -p 9200:9200 -p 9300:9300 --name elasticsearch harbor.dev.o19s.com/elastic-graph-recommender/elasticsearch:latest\ndocker run -d -p 8000:8000 --name app -e ELASTICSEARCH_URL=http://localhost:9200 harbor.dev.o19s.com/elastic-graph-recommender/app:latest\n```\n\nIf you are deploying in the cloud, remember that the `ELASTICSEARCH_URL` is pointing to the public URL for the Elasticsearch node, so update accordingly!\n\n\nLoad the demo data via:\n\n```\ndocker exec -it elasticsearch python /etl/rehashTmdbToMl.py\ndocker exec -it elasticsearch python /etl/indexMlTmdb.py http://localhost:9200 /etl/ml_tmdb.json\ndocker exec -it elasticsearch python /etl/ratingsToEs.py http://localhost:9200 /etl/ml_tmdb.json /etl/ml-20m/ratings.csv\n\n```\n\n## By using a blow torch\n\n```\ndocker login harbor.dev.o19s.com   # ask Eric for credentials\ndocker-compose up\n```\n\n\nBrowse to http://localhost:8000 to try it out!\n\n\n# Building Docker images\nBuild the docker images from scratch via:\n\n```\ndocker build -t elastic-graph-recommender/elasticsearch -f deploy/elasticsearch/Dockerfile .\ndocker build -t elastic-graph-recommender/app -f deploy/app/Dockerfile .\ndocker build -t elastic-graph-recommender/init -f deploy/init/Dockerfile .\n```\n\nDeploy to our private Docker registry http://harbor.dev.o19s.com:\n\n```\ndocker login harbor.dev.o19s.com\n\ndocker tag elastic-graph-recommender/elasticsearch harbor.dev.o19s.com/elastic-graph-recommender/elasticsearch\ndocker tag elastic-graph-recommender/app harbor.dev.o19s.com/elastic-graph-recommender/app\ndocker tag elastic-graph-recommender/init harbor.dev.o19s.com/elastic-graph-recommender/init\n\ndocker push harbor.dev.o19s.com/elastic-graph-recommender/elasticsearch\ndocker push harbor.dev.o19s.com/elastic-graph-recommender/app\ndocker push harbor.dev.o19s.com/elastic-graph-recommender/init\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo19s%2Felastic-graph-recommender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo19s%2Felastic-graph-recommender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo19s%2Felastic-graph-recommender/lists"}