{"id":16674028,"url":"https://github.com/sensorario/docker-elasticsearch","last_synced_at":"2026-04-29T17:09:08.225Z","repository":{"id":44779357,"uuid":"135389618","full_name":"sensorario/docker-elasticsearch","owner":"sensorario","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-25T10:21:49.000Z","size":13,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T02:41:44.617Z","etag":null,"topics":["dev-romagna","docker","elasticsearch"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","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/sensorario.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}},"created_at":"2018-05-30T04:51:44.000Z","updated_at":"2022-01-25T10:21:49.000Z","dependencies_parsed_at":"2022-08-25T11:31:35.007Z","dependency_job_id":null,"html_url":"https://github.com/sensorario/docker-elasticsearch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sensorario/docker-elasticsearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensorario%2Fdocker-elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensorario%2Fdocker-elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensorario%2Fdocker-elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensorario%2Fdocker-elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sensorario","download_url":"https://codeload.github.com/sensorario/docker-elasticsearch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensorario%2Fdocker-elasticsearch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32435236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"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":["dev-romagna","docker","elasticsearch"],"created_at":"2024-10-12T12:29:09.688Z","updated_at":"2026-04-29T17:09:08.209Z","avatar_url":"https://github.com/sensorario.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elasticsearch\n\n## Introduction\n\nES provides a REST interface to read and write data. In this repository I'll\nlist a couple of snippet or information to start to play with ES.\n\n## Install with docker\n\nWe'll use ES inside a docker machine.\n\nFirst of all pull docker image:\n\n```\n\u003e docker pull docker.elastic.co/elasticsearch/elasticsearch:6.2.4\n```\n\nSecond, run docker:\n\n```\n\u003e docker run -p 9300:9300 -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:6.2.4\n```\n\nNow start with CRUD operations\n\n## Create new index and properties mapping.\n\n### Request\n\nAn index is created just adding a resource.\n\n```\n\u003e  PUT http://localhost:9200/indice\n\u003e  {\n\u003e   \"mappings\": {\n\u003e     \u003ccose che mappo\u003e: {\n\u003e       \"properties\": {\n\u003e         \u003cchiave\u003e: {\n\u003e           \"type\": \u003ctipo della chiave\u003e\n\u003e         }\n\u003e       }\n\u003e     }\n\u003e   }\n\u003e  }\n```\n\n### Response\n\n```\n\u003c {\n\u003c     \"acknowledged\": true,\n\u003c     \"shards_acknowledged\": true,\n\u003c     \"index\": \"indice\"\n\u003c }\n```\n\n## See indexes in browser\n\n### Request\n\n```\n\u003e http://localhost:9200/_cat/indices\n```\n\n### Response\n\nyellow open indice                      Fly0K1RcSRumG86Xr-VYXQ 5 1   0  0   1.1kb   1.1kb\ngreen  open .monitoring-es-6-2018.05.29 rtrWxymcRe-p9SogkIC32w 1 0 318 55 392.3kb 392.3kb\n\n## Create new record\n\n### Request\n\n```\n\u003e PUT http://localhost:9200/indice/_doc/1\n\u003e {\n\u003e  \"ip_addr\": \"192.168.1.1\"\n\u003e }\n```\n\n### Response\n\n```\n\u003c {\n\u003c     \"_index\": \"indice\",\n\u003c     \"_type\": \"_doc\",\n\u003c     \"_id\": \"1\",\n\u003c     \"_version\": 1,\n\u003c     \"result\": \"created\",\n\u003c     \"_shards\": {\n\u003c         \"total\": 2,\n\u003c         \"successful\": 1,\n\u003c         \"failed\": 0\n\u003c     },\n\u003c     \"_seq_no\": 0,\n\u003c     \"_primary_term\": 1\n\u003c }\n```\n\n## Get record\n\n### Request\n\n```\n\u003e GET http://localhost:9200/indice/_doc/2\n```\n\n### Response\n\n```\n\u003c {\n\u003c     \"_index\": \"indice\",\n\u003c     \"_type\": \"_doc\",\n\u003c     \"_id\": \"2\",\n\u003c     \"_version\": 6,\n\u003c     \"found\": true,\n\u003c     \"_source\": {\n\u003c         \"ip_addr\": \"192.168.1.2\"\n\u003c     }\n\u003c }\n```\n\n## Search inside index\n\n### Request\n\n```\n\u003e Content-type: application/json\n\u003e GET http://localhost:9200/indice/_search/\n\u003e {\n\u003e   \"query\": {\n\u003e     \"term\": {\n\u003e       \"ip_addr\":\"192.168.2.2/16\"\n\u003e       }\n\u003e   }\n\u003e }\n```\n\n### Response\n\n```\n\u003c { \n\u003c   \"took\" : 3,\n\u003c   \"timed_out\" : false,\n\u003c   \"hits\" : {\n\u003c      \"total\" : 1,\n\u003c      \"max_score\" : 1,\n\u003c      \"hits\" : [\n\u003c         {\n\u003c            \"_score\" : 1,\n\u003c            \"_source\" : {\n\u003c               \"ip_addr\" : \"192.168.2.2\"\n\u003c            },\n\u003c            \"_type\" : \"_doc\",\n\u003c            \"_id\" : \"2\",\n\u003c            \"_index\" : \"indice\"\n\u003c         }\n\u003c      ]\n\u003c   },\n\u003c   \"_shards\" : {\n\u003c      \"failed\" : 0,\n\u003c      \"total\" : 5,\n\u003c      \"successful\" : 5,\n\u003c      \"skipped\" : 0\n\u003c   }\n\u003c }\n```\n\n## Multiple search\n\n### Request\n\n```\n\u003e GET index/type/_search\n\u003e {\n\u003e   \"query\": {\n\u003e     \"bool\": {\n\u003e       \"must\": [\n\u003e         {\n\u003e           \"match\": {\n\u003e             \"path.to.some.field.keyword\": \"value\"\n\u003e           }\n\u003e         },\n\u003e         {\n\u003e           \"match\": {\n\u003e             \"path.to.another.field.keyword\": \"another value\"\n\u003e           }\n\u003e         }\n\u003e       ]\n\u003e     }\n\u003e   }\n\u003e }\n```\n\n## Pagination\n\n### Limit and offset\n\n```\n\u003e GET index/type/_search?size=10\n\u003e GET index/type/_search?size=10\u0026from=42\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensorario%2Fdocker-elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensorario%2Fdocker-elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensorario%2Fdocker-elasticsearch/lists"}