{"id":16778366,"url":"https://github.com/davidefiocco/dockerized-elasticsearch-duplicate-finder","last_synced_at":"2026-05-19T14:05:21.006Z","repository":{"id":49713477,"uuid":"284548619","full_name":"davidefiocco/dockerized-elasticsearch-duplicate-finder","owner":"davidefiocco","description":"Attempt to use MinHash to find duplicates in an Elasticsearch index","archived":false,"fork":false,"pushed_at":"2024-05-03T20:00:41.000Z","size":12,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T15:50:43.016Z","etag":null,"topics":["duplicates","elasticsearch","minhash","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidefiocco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-08-02T21:58:11.000Z","updated_at":"2023-12-11T14:36:35.000Z","dependencies_parsed_at":"2024-12-18T13:54:38.613Z","dependency_job_id":null,"html_url":"https://github.com/davidefiocco/dockerized-elasticsearch-duplicate-finder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidefiocco%2Fdockerized-elasticsearch-duplicate-finder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidefiocco%2Fdockerized-elasticsearch-duplicate-finder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidefiocco%2Fdockerized-elasticsearch-duplicate-finder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidefiocco%2Fdockerized-elasticsearch-duplicate-finder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidefiocco","download_url":"https://codeload.github.com/davidefiocco/dockerized-elasticsearch-duplicate-finder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305947,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["duplicates","elasticsearch","minhash","python"],"created_at":"2024-10-13T07:27:32.432Z","updated_at":"2026-05-19T14:05:20.993Z","avatar_url":"https://github.com/davidefiocco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dockerized-elasticsearch-duplicate-finder\n\nFind near-duplicate documents using Elasticsearch's [MinHash](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-minhash-tokenfilter.html) token filter, running in Docker containers.\n\nBased on [this StackOverflow question](https://stackoverflow.com/questions/63221732/why-does-my-query-using-a-minhash-analyzer-fail-to-retrieve-duplicates).\n\n## Quick start\n\n```bash\ndocker compose build\ndocker compose up\n```\n\nThis indexes the example corpus at `data/mydocs.jsonl` and starts the API on port 8000.\n\n## Query for duplicates\n\n```bash\ncurl -X POST \"http://localhost:8000/duplicates?k=5\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"text\": \"your text here\"}'\n```\n\n## Using a custom corpus\n\nProvide any JSONL file with `id` and `text` fields:\n\n```jsonl\n{\"id\": 1, \"text\": \"First document\"}\n{\"id\": 2, \"text\": \"Second document\"}\n```\n\nMount it by editing the indexer volume in `docker-compose.yml`:\n\n```yaml\nindexer:\n  volumes:\n    - ./path/to/your/corpus.jsonl:/data/corpus.jsonl:ro\n```\n\nThen `docker compose up` (add `--build` if the images haven't been built yet).\n\nA download script for [HuggingFace's AG News dataset](https://huggingface.co/datasets/fancyzhx/ag_news) (120k articles) is included:\n\n```bash\npip install datasets\npython scripts/download_corpus.py 120000  # writes corpus.jsonl\n```\n\n## Stack\n\n- **Elasticsearch 8.17** — MinHash analyzer (5-gram shingles, 256 hash buckets)\n- **Indexer** — Python 3.12, bulk-indexes JSONL into ES\n- **Classifier** — Python 3.12, FastAPI, exposes `/duplicates` endpoint\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidefiocco%2Fdockerized-elasticsearch-duplicate-finder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidefiocco%2Fdockerized-elasticsearch-duplicate-finder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidefiocco%2Fdockerized-elasticsearch-duplicate-finder/lists"}