{"id":13508923,"url":"https://github.com/Zatvobor/tirexs","last_synced_at":"2025-03-30T11:33:02.641Z","repository":{"id":719998,"uuid":"8202921","full_name":"Zatvobor/tirexs","owner":"Zatvobor","description":"An Elixir flavored HTTP client and DSL library for Elasticsearch","archived":false,"fork":false,"pushed_at":"2022-01-10T05:34:18.000Z","size":663,"stargazers_count":429,"open_issues_count":30,"forks_count":93,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-23T17:02:46.362Z","etag":null,"topics":["elasticsearch"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/tirexs/api-reference.html","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zatvobor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-14T16:22:03.000Z","updated_at":"2024-07-25T10:58:40.000Z","dependencies_parsed_at":"2022-07-20T04:02:38.176Z","dependency_job_id":null,"html_url":"https://github.com/Zatvobor/tirexs","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zatvobor%2Ftirexs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zatvobor%2Ftirexs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zatvobor%2Ftirexs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zatvobor%2Ftirexs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zatvobor","download_url":"https://codeload.github.com/Zatvobor/tirexs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314044,"owners_count":20757455,"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"],"created_at":"2024-08-01T02:01:00.498Z","updated_at":"2025-03-30T11:33:02.150Z","avatar_url":"https://github.com/Zatvobor.png","language":"Elixir","funding_links":[],"categories":["ORM and Datamapping"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Zatvobor/tirexs.svg?branch=master)](https://travis-ci.org/Zatvobor/tirexs) [![HEX version](https://img.shields.io/hexpm/v/tirexs.svg)](https://hex.pm/packages/tirexs) [![HEX downloads](https://img.shields.io/hexpm/dw/tirexs.svg)](https://hex.pm/packages/tirexs) [![Deps Status](https://beta.hexfaktor.org/badge/all/github/Zatvobor/tirexs.svg)](https://beta.hexfaktor.org/github/Zatvobor/tirexs)\n\nAn Elixir flavored HTTP client and DSL library for building JSON based settings, mappings, queries to Elasticsearch engine.\n\n## Getting Started\n\n1. Add this to the `defp deps do` list in your mix.exs file:\n\n  ```elixir\n  {:tirexs, \"~\u003e 0.8\"}\n  ```\n\n2. Also in mix.exs, add `:tirexs` to the `:applications` list in `def application`.\n3. In config/dev.exs, configure `tirexs`:\n\n   ```elixir\n   # The default uri is http://127.0.0.1:9200\n   config :tirexs, :uri, \"http://127.0.0.1:9200\"\n   ```\n\n   See [lib/tirexs/env.ex](https://github.com/Zatvobor/tirexs/blob/master/lib/tirexs/env.ex) for more configuration options.\n4. Index a document:\n\n  ```elixir\n  import Tirexs.HTTP\n\n  put(\"/my_index/users/1\", [name: \"Jane\", email: \"jane@example.com\"])\n  # {:ok, 201,\n  #  %{_id: \"1\", _index: \"my_index\", _type: \"users\", _version: 1, created: true}}\n  ```\n5. Fetch the document:\n\n  ```elixir\n  get(\"/my_index/users/1\")\n  #  {:ok, 200,\n  #   %{_id: \"1\", _index: \"my_index\",\n  #     _source: %{email: \"jane@example.com\", name: \"Jane\"}, _type: \"users\",\n  #     _version: 1, found: true}}\n  ```\n6. Simplified search:\n\n  ```elixir\n  get(\"/my_index/users/_search?q=name:jane\")\n  #  {:ok, 200,\n  #   %{_shards: %{failed: 0, successful: 5, total: 5},\n  #     hits: %{hits: [%{_id: \"1\", _index: \"my_index\", _score: 0.30685282,\n  #          _source: %{email: \"jane@example.com\", name: \"Jane\"}, _type: \"users\"}],\n  #       max_score: 0.30685282, total: 1}, timed_out: false, took: 10}}\n  ```\n7. Query DSL\n\n  ```elixir\n  import Tirexs.Search\n\n  query = search [index: \"my_index\"] do\n    query do\n      match \"name\", \"jane\"\n    end\n  end\n  # [search: [query: [match: [name: [query: \"jane\"]]]], index: \"my_index\"]\n\n  Tirexs.Query.create_resource(query)\n  #  {:ok, 200,\n  #   %{_shards: %{failed: 0, successful: 5, total: 5},\n  #     hits: %{hits: [%{_id: \"1\", _index: \"my_index\", _score: 0.30685282,\n  #          _source: %{email: \"jane@example.com\", name: \"Jane\"}, _type: \"users\"}],\n  #       max_score: 0.30685282, total: 1}, timed_out: false, took: 5}}\n  ```\n\nCheck out [/examples](/examples) directory as a quick intro.\n\n[![Gitter](https://badges.gitter.im/Zatvobor/tirexs.svg)](https://gitter.im/Zatvobor/tirexs?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n## tirexs is split into several layers\n\n- [Raw HTTP layer](https://hexdocs.pm/tirexs/Tirexs.HTTP.html) and [API helpers](https://hexdocs.pm/tirexs/Tirexs.Resources.APIs.html)\n- Multiple operations in single call such as [Bulk API](https://hexdocs.pm/tirexs/Tirexs.Bulk.html) and [mget API](https://hexdocs.pm/tirexs/Tirexs.MultiGet.html)\n- [DSL flavored helpers](https://hexdocs.pm/tirexs/Tirexs.DSL.html)\n\nFind out more in [api reference](https://hexdocs.pm/tirexs/api-reference.html)\n\n## Not sure?\nLook around using [https://hex.pm/packages?search=elasticsearch...](https://hex.pm/packages?search=elasticsearch\u0026sort=downloads) to find out some other packages.\n\n## Contributing\nIf you feel like porting or fixing something, please drop a [pull request](https://github.com/Zatvobor/tirexs/pulls) or [issue tracker](https://github.com/Zatvobor/tirexs/issues) at GitHub! Check out the [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\n\n## License\n`Tirexs` source code is released under Apache 2 License.\nCheck [LICENSE](LICENSE) and [NOTICE](NOTICE) files for more details. The project HEAD is https://github.com/zatvobor/tirexs.\n\n[![Analytics](https://ga-beacon.appspot.com/UA-61065309-1/Zatvobor/tirexs/README)](https://github.com/igrigorik/ga-beacon)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZatvobor%2Ftirexs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZatvobor%2Ftirexs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZatvobor%2Ftirexs/lists"}