{"id":18918259,"url":"https://github.com/avidbyte/escurlgen","last_synced_at":"2026-03-19T07:08:02.574Z","repository":{"id":258238082,"uuid":"872901982","full_name":"avidbyte/ESCurlGen","owner":"avidbyte","description":"生成 es curl 命令的小工具","archived":false,"fork":false,"pushed_at":"2024-12-14T13:14:27.000Z","size":300,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-24T20:41:02.269Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/avidbyte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-15T09:14:35.000Z","updated_at":"2024-12-14T13:14:30.000Z","dependencies_parsed_at":"2024-10-19T10:50:54.688Z","dependency_job_id":null,"html_url":"https://github.com/avidbyte/ESCurlGen","commit_stats":null,"previous_names":["avidbyte/escurlgen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avidbyte/ESCurlGen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidbyte%2FESCurlGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidbyte%2FESCurlGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidbyte%2FESCurlGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidbyte%2FESCurlGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avidbyte","download_url":"https://codeload.github.com/avidbyte/ESCurlGen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidbyte%2FESCurlGen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28799586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"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":[],"created_at":"2024-11-08T10:30:46.397Z","updated_at":"2026-01-27T03:33:38.941Z","avatar_url":"https://github.com/avidbyte.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESCurlGen\n由于经常编写复杂的 Elasticsearch 查询，并通过代码生成查询条件，我发现每次使用 curl 请求 Elasticsearch 时，手动复制配置信息并构建 curl 命令的过程非常繁琐，尤其是在管理多个环境的情况下更为不便。因此，我利用 AI 技术开发了一款 Web 工具，经过一系列优化和改进，该工具能够智能拼接配置信息，自动生成完整的 Elasticsearch curl 命令，极大提升了工作效率。\n![工具截图](https://github.com/avidbyte/ESCurlGen/blob/main/Snipaste_2024-10-15_17-44-58.png \"可选标题\")\n\n访问地址可直接使用（需科学上网） https://avidbyte.github.io/ESCurlGen/\n\n# 功能介绍 测试示例 my_user_index 索引\n\n## 1.创建索引\n```json\n{\n  \"mappings\": {\n    \"properties\": {\n      \"id\": { \"type\": \"keyword\" },\n      \"name\": { \"type\": \"text\", \"fields\": { \"keyword\": { \"type\": \"keyword\" } } },\n      \"phone\": { \"type\": \"text\", \"fields\": { \"keyword\": { \"type\": \"keyword\" } } },\n      \"birthday\": { \"type\": \"date\" },\n      \"createTime\": { \"type\": \"date\" }\n    }\n  }\n}\n```\n\n\n## 2.新增索引字段\n```json\n{\n  \"properties\": {\n    \"address\": { \"type\": \"text\", \"fields\": { \"keyword\": { \"type\": \"keyword\" } } }\n  }\n}\n```\n\n## 3.查询 settings\n## 4.查询 Mapping\n\n## 5.新增数据\n```json\n{\n  \"id\": \"1\",\n  \"name\": \"John Doe\",\n  \"phone\": \"123-456-7890\",\n  \"birthday\": \"1990-01-01\",\n  \"createTime\": \"2023-10-10T08:00:00Z\",\n  \"address\": \"123 Main St\"\n}\n```\n```json\n{\n  \"id\": \"2\",\n  \"name\": \"Jane Smith\",\n  \"phone\": \"098-765-4321\",\n  \"birthday\": \"1985-05-05\",\n  \"createTime\": \"2023-10-11T09:00:00Z\",\n  \"address\": \"456 Oak Ave\"\n}\n```\n\n## 6.批量操作（批量新增）\n\n```json lines\n{ \"index\": { \"_id\": \"3\" } }\n{ \"name\": \"User One\", \"phone\": \"1234567890\", \"birthday\": \"1995-05-05\", \"createTime\": \"2024-10-17T10:00:00\", \"address\": \"789 Elm St\" }\n{ \"index\": { \"_id\": \"4\" } }\n{ \"name\": \"User Two\", \"phone\": \"0987654321\", \"birthday\": \"1988-07-15\", \"createTime\": \"2024-10-17T11:00:00\", \"address\": \"1234 Oak St\" }\n```\n\n\n## 7.查询索引数据条数\n\n## 8.根据条件查询\n```json\n{\n  \"query\": {\n    \"match\": {\n      \"name\": \"John Doe\"\n    }\n  }\n}\n```\n## 9.根据 ID 查询\n\n## 10.滚动查询\n```json\n{\n  \"size\": 2,\n  \"query\": {\n    \"match_all\": {\n    }\n  }\n}\n```\n在初次滚动查询后，您需要使用 scroll_id 进行后续请求：\n```json\n{\n  \"scroll\": \"1m\",\n  \"scroll_id\": \"DXF1ZXJ5QW5kRmV0Y2gBAAAAAA...\"\n}\n```\n\n## 11.根据 ID 更新数据\n```json\n{\n  \"doc\": {\n    \"phone\": \"555-555-5555\",\n    \"createTime\": \"2024-10-17T00:00:00Z\"\n  }\n}\n```\n\n\n## 12.根据自定义条件更新数据\n\n```json\n{\n  \"query\": {\n    \"match\": {\n      \"name\": \"Jane Doe\"\n    }\n  },\n  \"script\": {\n    \"source\": \"ctx._source.phone = params.phone; ctx._source.address = params.address\",\n    \"params\": {\n      \"phone\": \"5555555555\",\n      \"address\": \"222 Elm St\"\n    },\n    \"lang\": \"painless\"\n  }\n}\n```\n\n## 13.根据 ID 删除数据\n\n## 14.根据自定义条件删除数据\n```json\n{\n  \"query\": {\n    \"match\": {\n      \"name\": \"Jane Doe\"\n    }\n  }\n}\n```\n\n## 15.删除索引\n\n\n\n## 16.批量更新文档 (2024-12-14新增)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favidbyte%2Fescurlgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favidbyte%2Fescurlgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favidbyte%2Fescurlgen/lists"}