{"id":13624969,"url":"https://github.com/vinted/elasticsearch-dsl-rs","last_synced_at":"2025-04-16T01:33:09.779Z","repository":{"id":36959169,"uuid":"418392122","full_name":"vinted/elasticsearch-dsl-rs","owner":"vinted","description":"Strongly typed Elasticsearch DSL written in Rust","archived":false,"fork":false,"pushed_at":"2025-03-12T06:50:51.000Z","size":703,"stargazers_count":209,"open_issues_count":5,"forks_count":19,"subscribers_count":83,"default_branch":"master","last_synced_at":"2025-03-12T07:30:52.922Z","etag":null,"topics":["elasticsearch","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/vinted.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-18T07:32:05.000Z","updated_at":"2025-03-12T06:50:53.000Z","dependencies_parsed_at":"2023-10-02T06:26:49.603Z","dependency_job_id":"cadff511-52bb-47ca-be28-3b9f5624ef19","html_url":"https://github.com/vinted/elasticsearch-dsl-rs","commit_stats":{"total_commits":202,"total_committers":10,"mean_commits":20.2,"dds":"0.13861386138613863","last_synced_commit":"653e66f2b1c46fd2bc7d48fce8b2b92a35ea78de"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinted%2Felasticsearch-dsl-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinted%2Felasticsearch-dsl-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinted%2Felasticsearch-dsl-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinted%2Felasticsearch-dsl-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinted","download_url":"https://codeload.github.com/vinted/elasticsearch-dsl-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182490,"owners_count":21226074,"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","rust"],"created_at":"2024-08-01T21:01:48.883Z","updated_at":"2025-04-16T01:33:09.773Z","avatar_url":"https://github.com/vinted.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Strongly typed Elasticsearch DSL written in Rust\n\n[![Crates.io](https://img.shields.io/crates/v/elasticsearch-dsl)](https://crates.io/crates/elasticsearch-dsl)\n[![Crates.io](https://img.shields.io/crates/l/elasticsearch-dsl)](https://crates.io/crates/elasticsearch-dsl)\n[![Crates.io](https://img.shields.io/crates/d/elasticsearch-dsl)](https://crates.io/crates/elasticsearch-dsl)\n[![Docs.io](https://docs.rs/elasticsearch-dsl/badge.svg)](https://docs.rs/elasticsearch-dsl)\n[![Rust](https://github.com/vinted/elasticsearch-dsl-rs/actions/workflows/CI.yml/badge.svg)](https://github.com/vinted/elasticsearch-dsl-rs/actions/workflows/CI.yml)\n\nA high level library, giving a strongly typed DSL that maps one to one with the official\nElasticsearch query DSL.\n\n## Features\n\n- Strongly typed queries\n- Strongly typed aggregations\n- Strongly typed completions\n- Response structures\n- Automatically skips empty queries making DSL pleasant to use\n- Crate doesn't depend on [elasticsearch-rs](https://github.com/elastic/elasticsearch-rs) and can\n  be used as a standalone library with any HTTP client to call Elasticsearch\n\n## Installation\n\nAdd `elasticsearch-dsl` crate and version to Cargo.toml\n\n```toml\n[dependencies]\nelasticsearch-dsl = \"0.4\"\n```\n\n## Documentation\n\nDocumentation for the library is available on [docs.rs](https://docs.rs/elasticsearch-dsl)\n\n## Quick start\n\n```rust\nuse elasticsearch_dsl::*;\n\nfn main() {\n    let query = Search::new()\n        .source(false)\n        .stats(\"statistics\")\n        .from(0)\n        .size(30)\n        .query(\n            Query::bool()\n                .must(Query::multi_match(\n                    [\"title\", \"description\"],\n                    \"you know, for search\",\n                ))\n                .filter(Query::terms(\"tags\", [\"elasticsearch\"]))\n                .should(Query::term(\"verified\", true).boost(10)),\n        )\n        .aggregate(\n            \"country_ids\",\n            Aggregation::terms(\"country_id\")\n                .aggregate(\"catalog_ids\", Aggregation::terms(\"catalog_id\"))\n                .aggregate(\"company_ids\", Aggregation::terms(\"company_id\"))\n                .aggregate(\n                    \"top1\",\n                    Aggregation::top_hits()\n                        .size(1)\n                        .sort(FieldSort::ascending(\"user_id\")),\n                ),\n        )\n        .rescore(Rescore::new(Query::term(\"field\", 1)).query_weight(1.2));\n}\n```\n\n```json\n{\n  \"_source\": false,\n  \"stats\": [\"statistics\"],\n  \"from\": 0,\n  \"size\": 30,\n  \"query\": {\n    \"bool\": {\n      \"must\": [\n        {\n          \"multi_match\": {\n            \"fields\": [\"title\", \"description\"],\n            \"query\": \"you know, for search\"\n          }\n        }\n      ],\n      \"filter\": [{ \"terms\": { \"tags\": [\"elasticsearch\"] } }],\n      \"should\": [{ \"term\": { \"verified\": { \"value\": true, \"boost\": 10.0 } } }]\n    }\n  },\n  \"aggs\": {\n    \"country_ids\": {\n      \"terms\": { \"field\": \"country_id\" },\n      \"aggs\": {\n        \"catalog_ids\": { \"terms\": { \"field\": \"catalog_id\" } },\n        \"company_ids\": { \"terms\": { \"field\": \"company_id\" } },\n        \"top1\": {\n          \"top_hits\": {\n            \"size\": 1,\n            \"sort\": [{ \"user_id\": { \"order\": \"asc\" } }]\n          }\n        }\n      }\n    }\n  },\n  \"rescore\": [\n    {\n      \"query\": {\n        \"rescore_query\": { \"term\": { \"field\": { \"value\": 1 } } },\n        \"query_weight\": 1.2\n      }\n    }\n  ]\n}\n```\n\nSee [examples](examples) for more.\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinted%2Felasticsearch-dsl-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinted%2Felasticsearch-dsl-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinted%2Felasticsearch-dsl-rs/lists"}