{"id":14779794,"url":"https://github.com/sdqri/effdsl","last_synced_at":"2026-01-11T22:58:24.614Z","repository":{"id":65423983,"uuid":"591973439","full_name":"sdqri/effdsl","owner":"sdqri","description":"Elasticsearch query builder for golang","archived":false,"fork":false,"pushed_at":"2024-12-16T08:42:18.000Z","size":844,"stargazers_count":27,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-16T09:32:36.609Z","etag":null,"topics":["elasticsearch","golang","orm","query-builder","querydsl"],"latest_commit_sha":null,"homepage":"https://sdqri.github.io/effdsl/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdqri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-22T14:36:02.000Z","updated_at":"2024-12-16T08:42:22.000Z","dependencies_parsed_at":"2024-09-16T08:51:23.833Z","dependency_job_id":"240ff741-b10b-45d9-9d25-51d752476db6","html_url":"https://github.com/sdqri/effdsl","commit_stats":{"total_commits":31,"total_committers":4,"mean_commits":7.75,"dds":"0.25806451612903225","last_synced_commit":"9a605a4303c307f3fd81a15951bca78c4818d68a"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdqri%2Feffdsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdqri%2Feffdsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdqri%2Feffdsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdqri%2Feffdsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdqri","download_url":"https://codeload.github.com/sdqri/effdsl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233035235,"owners_count":18614970,"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":["elasticsearch","golang","orm","query-builder","querydsl"],"created_at":"2024-09-17T01:00:59.764Z","updated_at":"2026-01-11T22:58:24.608Z","avatar_url":"https://github.com/sdqri.png","language":"Go","funding_links":[],"categories":["数据库驱动程序","Database Drivers","Recently Updated","Data Integration Frameworks"],"sub_categories":["检索及分析资料库","Search and Analytic Databases","[Sep 15, 2024](/content/2024/09/15/README.md)"],"readme":"# effdsl\n\n![GitHub Release](https://img.shields.io/github/v/release/sdqri/effdsl)\n[![GoDoc](https://pkg.go.dev/badge/github.com/sdqri/effdsl/v2?status.svg)](https://pkg.go.dev/github.com/sdqri/effdsl/v2?tab=doc)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sdqri/effdsl)](https://goreportcard.com/report/github.com/sdqri/effdsl)\n![GitHub License](https://img.shields.io/github/license/sdqri/effdsl)\n\u003ca href=\"https://github.com/sdqri/effdsl/pulls\" style=\"text-decoration: none;\"\u003e\u003cimg src=\"https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat\" alt=\"Contributions welcome\"\u003e\u003c/a\u003e\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)  \n\nThis module provides a simple and functional way to build Elasticsearch queries in Go.\n\n### 🚀 Key Features\n\n- **Type-safe query construction:** 🛡️ Avoids error-prone maps and raw string literals by using intuitive function calls, enhancing type safety, auto-completion, and compile-time validation.\n- **Procedural query creation:** ✨ Designed for straightforward and refined query building, particularly useful when queries need to be generated programmatically.\n- **Comprehensive query support:** 📚 Covers most compound, full-text, and term-level queries, with easy extension for additional types.\n\nFor more information, detailed guides, and examples, please read the [documentation](https://sdqri.github.io/effdsl).\n\n## Getting started\n\n### Getting effdsl\n\nWith [Go module](https://github.com/golang/go/wiki/Modules) support, simply add the following import\n\n```\nimport \"github.com/sdqri/effdsl/v2\"\n```\n\nto your code, and then `go [build|run|test]` will automatically fetch the necessary dependencies.\n\nOtherwise, run the following Go command to install the `effdsl` package:\n\n```sh\n$ go get -u github.com/sdqri/effdsl/v2\n```\n\n### How to use\n\nStart with `effdsl.Define()`, and use types and documentations to find suitable options.\n\n### 🔍 Examples:\n\n**Traditional Way:**\n\nHere’s a simple match query in the traditional way using raw strings in Go:\n\n```go\nimport (\n    es \"github.com/elastic/go-elasticsearch/v8\"\n)\n\nquery := `{\n  \"query\": {\n    \"match\": {\n      \"message\": {\n        \"query\": \"Hello World\"\n      }\n    }\n  }\n}`\n\nres, err := es.Search(\n  es.Search.WithBody(strings.NewReader(query)),\n)\n```\n\n**Using effdsl:**\n\nAnd here’s the same query using effdsl:\n\n```go\nimport (\n    es \"github.com/elastic/go-elasticsearch/v8\"\n    \n    \"github.com/sdqri/effdsl/v2\"\n    mq \"github.com/sdqri/effdsl/v2/queries/matchquery\"\n)\n\nquery, err := effdsl.Define(\n    effdsl.WithQuery(\n        mq.MatchQuery(\"message\", \"Hello World\"),\n    ),\n)\n\nres, err := es.Search(\n  es.Search.WithBody(strings.NewReader(query)),\n)\n```\n\nFor more examples and details on query parameters, visit the [documentation](https://sdqri.github.io/effdsl).\n\n## 🤝 Contribution\nContributions are welcome! Whether it's fixing a bug 🐛, adding a new feature 🌟, or improving the documentation 📚, your help is appreciated. Please check out the CONTRIBUTING.md guide to get started.\n\n## 📜 License\nThis project is licensed under the **MIT License**. For more details, see the [License](LICENSE.md) file. 📄 ( **In short:** You can use, modify, and distribute this software freely as long as you include the original copyright notice and license. The software is provided \"as-is\" without warranties or guarantees.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdqri%2Feffdsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdqri%2Feffdsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdqri%2Feffdsl/lists"}