{"id":18015596,"url":"https://github.com/nomemory/elasticpoc","last_synced_at":"2025-07-05T00:38:46.545Z","repository":{"id":82269815,"uuid":"215788715","full_name":"nomemory/elasticpoc","owner":"nomemory","description":"Elastic POC","archived":false,"fork":false,"pushed_at":"2019-10-18T09:08:15.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T00:48:35.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/nomemory.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":"2019-10-17T12:37:18.000Z","updated_at":"2025-01-10T07:05:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"6aef1bea-a38c-439a-98bb-467862049adc","html_url":"https://github.com/nomemory/elasticpoc","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/nomemory%2Felasticpoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomemory%2Felasticpoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomemory%2Felasticpoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomemory%2Felasticpoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nomemory","download_url":"https://codeload.github.com/nomemory/elasticpoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198473,"owners_count":20900082,"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":[],"created_at":"2024-10-30T04:14:29.295Z","updated_at":"2025-04-04T15:17:30.113Z","avatar_url":"https://github.com/nomemory.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elasticpoc\n\n## Run the POC\n\n### Use the right elasticsearch image\n\nCheck if `docker.elastic.co/elasticsearch/elasticsearch 7.3.2` is available as docker image:\n\n```\ndocker images\n```\n\nExpected output:\n\n```\nREPOSITORY                                      TAG                 IMAGE ID            CREATED             SIZE\ndocker.elastic.co/elasticsearch/elasticsearch   7.3.2               d7052f192d01        5 weeks ago         706MB\n```\n\nIf not, pull the image\n\n```\ndocker pull docker.elastic.co/elasticsearch/elasticsearch:7.3.2\n```\n\n### Run \"containerized\" elasticsearch\n\nCheck in the source folder the script `docker.sh` or run the following command manually:\n\n```\ndocker run -p 9200:9200 -p 9300:9300 -e \"discovery.type=single-node\" docker.elastic.co/elasticsearch/elasticsearch:7.3.2\n```\n\nPS: Normally this should be included in the gradle build.\n\n### Test if elasticsearch is running correctly on the machine\n\n```\ncurl localhost:9200/\n```\n\nA similar output should appear:\n\n```\n{\n  \"name\" : \"3e6c4e78bb05\",\n  \"cluster_name\" : \"docker-cluster\",\n  \"cluster_uuid\" : \"Lj73nRs8RSSorLDim9vNqQ\",\n  \"version\" : {\n    \"number\" : \"7.3.2\",\n    \"build_flavor\" : \"default\",\n    \"build_type\" : \"docker\",\n    \"build_hash\" : \"1c1faf1\",\n    \"build_date\" : \"2019-09-06T14:40:30.409026Z\",\n    \"build_snapshot\" : false,\n    \"lucene_version\" : \"8.1.0\",\n    \"minimum_wire_compatibility_version\" : \"6.8.0\",\n    \"minimum_index_compatibility_version\" : \"6.0.0-beta1\"\n  },\n  \"tagline\" : \"You Know, for Search\"\n}\n```\n\n### Have some data generated\n\nChange directory to the datagen/ module, and run the gradle task in the that folder:\n\n```\ngradle run\n```\n\nTwo files `people.csv` and `people_cities.csv` will be generated.\n\n### Open all the microservices\n\nAll the microservices can be opened with the associated gradle task (gradle can be run directly from `elasticpoc/`):\n\n| Microservice | Gradle | Swagger URL |\n| ------------ | ------ | ------- |\n| Catalog | `gradle :catalog:bootRun`| http://localhost:8081/swagger-ui.html |\n| Query | `gradle :query:bootRun` | http://localhost:8083/swagger-ui.html |\n| Store | `gradle :store:bootRun` | http://localhost:8082/swagger-ui.html |\n\n### Setting up a clean elasticsearch setup\n\nTo clear and recreate every indices, mappings and pipelines in elastic it's recommended to call the `/setup/` rest controller.\n\n```\ncurl -X GET \"http://localhost:8081/setup/\" -H \"accept: */*\"\n```\n\nAfter succesfuly running this we have:\n* Created the `person` mapping;\n* Created the pipelines to load `person`(s) and `person-cities` associations.\n\n### Loading the initial sets of data\n\nTo insert the data we generated at the previous step we can use the swagger interface:\nhttp://localhost:8082/swagger-ui.html#/store-controller/insertBulkUsingPOST\n\nOr we can `curl` to make the request:\n\n```\ncurl -X POST \"http://localhost:8082/insert/bulk/person/person-pipeline\" -H \"accept: */*\" -H \"Content-Type: multipart/form-data\" -F \"file=@people.csv;type=text/csv\"\n```\n\nand \n\n```\ncurl -X POST \"http://localhost:8082/insert/bulk/person/person-city-pipeline\" -H \"accept: */*\" -H \"Content-Type: multipart/form-data\" -F \"file=@people_cities.csv;type=text/csv\"\n```\n\n### Querying\n\nTo test if a person visited a city you can use the swagger interface:\nhttp://localhost:8083/swagger-ui.html#/query-controller/visitedUsingPOST\n\nOr a direct curl:\n\n```\ncurl -X POST \"http://localhost:8083/query/visited\" -H \"accept: */*\" -H \"Content-Type: application/json\" -d \"{ \\\"city\\\": \\\"Jerusalem\\\", \\\"name\\\": \\\"Raphael Grout\\\"}\"\n```\n\n(Because different data can be generated, please use correct query entries)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomemory%2Felasticpoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnomemory%2Felasticpoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomemory%2Felasticpoc/lists"}