{"id":21988307,"url":"https://github.com/salithaucsc/es-rest-api","last_synced_at":"2026-04-17T05:31:27.625Z","repository":{"id":115901766,"uuid":"254792814","full_name":"SalithaUCSC/es-rest-api","owner":"SalithaUCSC","description":"REST API written to handle documents with Elastic Search using Java Play framework.","archived":false,"fork":false,"pushed_at":"2020-04-11T06:24:49.000Z","size":197,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T02:42:06.567Z","etag":null,"topics":["elasticsearch","java","play-framework","rest","rest-api"],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/SalithaUCSC.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-04-11T04:30:52.000Z","updated_at":"2020-04-11T06:24:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa64d14a-1575-47d6-a237-7ed6aca8f66d","html_url":"https://github.com/SalithaUCSC/es-rest-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SalithaUCSC/es-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalithaUCSC%2Fes-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalithaUCSC%2Fes-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalithaUCSC%2Fes-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalithaUCSC%2Fes-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SalithaUCSC","download_url":"https://codeload.github.com/SalithaUCSC/es-rest-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalithaUCSC%2Fes-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31916722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","java","play-framework","rest","rest-api"],"created_at":"2024-11-29T19:17:09.216Z","updated_at":"2026-04-17T05:31:27.606Z","avatar_url":"https://github.com/SalithaUCSC.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ES-Rest-API\nREST API written to handle documents with Elastic Search using Java Play framework.\n\n## ES REST API Endpoints\n```GET      /account/search```\n\n```GET      /account/search/by_account/:accountNumber```\n\n```GET      /account/search/by_name/:name```\n\n```GET      /account/search/by_age/:age```\n\n```GET      /account/search/aggregation```\n\n```POST     /account/create```\n\n```DELETE   /account/delete/:id```\n\n```POST     /index/create```\n\n```DELETE   /index/delete/:name```\n\n\n## ES Index Structure\n\n\u003e PUT es-demo\n```java\n{\n  \"settings\": {\n    \"analysis\": {\n      \"filter\": {\n        \"english_stop\": {\n          \"type\": \"stop\",\n          \"stopwords\": \"_english_\"\n        }\n      },\n      \"analyzer\": {\n        \"custom_english_analyzer\": {\n          \"filter\": [\n            \"lowercase\",\n            \"english_stop\"\n          ],\n          \"type\": \"custom\",\n          \"tokenizer\": \"standard\"\n        }\n      }\n    }\n  },\n  \"mappings\": {\n    \"account\": {\n      \"properties\": {\n        \"account_number\": {\n          \"type\": \"integer\"\n        },\n        \"balance\": {\n          \"type\": \"integer\"\n        },\n        \"firstname\": {\n          \"type\": \"text\",\n          \"analyzer\": \"standard\"\n        },\n        \"lastName\": {\n          \"type\": \"text\",\n          \"analyzer\": \"standard\"\n        },\n        \"age\": {\n          \"type\": \"integer\"\n        },\n        \"gender\": {\n          \"type\": \"keyword\"\n        },\n        \"address\": {\n          \"type\": \"text\",\n          \"analyzer\": \"custom_english_analyzer\"\n        },\n        \"email\": {\n          \"type\": \"keyword\"\n        },\n        \"city\": {\n          \"type\": \"text\",\n          \"analyzer\": \"custom_english_analyzer\"\n        },\n        \"state\": {\n          \"type\": \"text\",\n          \"analyzer\": \"custom_english_analyzer\"\n        }\n      }\n    }\n  }\n}\n```\n\n## ES Document Structure\n\n\u003e \n```java\n{\n    \"account_number\" : 25,\n    \"balance\" : 40540,\n    \"firstname\" : \"Virginia\",\n    \"lastname\" : \"Ayala\",\n    \"age\" : 39,\n    \"gender\" : \"F\",\n    \"address\" : \"171 Putnam Avenue\",\n    \"employer\" : \"Filodyne\",\n    \"email\" : \"virginiaayala@filodyne.com\",\n    \"city\" : \"Nicholson\",\n    \"state\" : \"PA\"\n}\n```\n\n## ES Queries\n\n### ES Search - All\n\u003e GET es-demo/account/_search\n\n### ES Search - Range Query\n```java\n{\n  \"query\": {\n    \"range\": {\n      \"age\": {\n        \"gte\": 40\n      }\n    }\n  }\n}\n```\n\n### ES Search - Multi Match Query\n\u003e GET es-demo/account/_search\n```java\n{\n  \"query\": {\n    \"multi_match\": {\n      \"query\": \"bates\",\n      \"fields\": [\"firstname\", \"lastName\", \"city\"]\n    }\n  }\n}\n```\n\n### ES Search - Bool Query\n\u003e GET es-demo/account/_search\n```java\n{\n  \"query\": {\n    \"bool\": {\n      \"filter\": {\n        \"term\": {\n          \"gender\": \"M\"\n        }\n      }, \n      \"must\": [\n        {\n          \"term\": {\n            \"age\": {\n              \"value\": \"20\"\n            }\n          }\n        }\n      ],\n      \"must_not\": [\n        {\n          \"term\": {\n            \"state\": {\n              \"value\": \"NM\"\n            }\n          }\n        }\n      ]\n    }\n  }\n}\n```\n\n### ES Search - Aggregation Query\n\u003e GET es-demo/account/_search\n```java\n{\n  \"size\": 0, \n  \"query\": {\n    \"match_all\": {}\n  },\n  \"aggs\": {\n    \"AGE_AGGREGATION\": {\n      \"terms\": {\n        \"field\": \"age\",\n        \"size\": 100\n      },\n      \"aggs\": {\n        \"GENDER AGGREGATION\": {\n          \"terms\": {\n            \"field\": \"gender\",\n            \"size\": 100\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalithaucsc%2Fes-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalithaucsc%2Fes-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalithaucsc%2Fes-rest-api/lists"}