ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - Zatvobor/tirexs: An Elixir flavored HTTP client and DSL library for Elasticsearch
An Elixir flavored HTTP client and DSL library for Elasticsearch - Zatvobor/tirexs
Visit Site

GitHub - Zatvobor/tirexs: An Elixir flavored HTTP client and DSL library for Elasticsearch

GitHub - Zatvobor/tirexs: An Elixir flavored HTTP client and DSL library for Elasticsearch

Build Status HEX version HEX downloads Deps Status

An Elixir flavored HTTP client and DSL library for building JSON based settings, mappings, queries to Elasticsearch engine.

Getting Started

  1. Add this to the defp deps do list in your mix.exs file:
{:tirexs, "~> 0.8"}
  1. Also in mix.exs, add :tirexs to the :applications list in def application.

  2. In config/dev.exs, configure tirexs:

    # The default uri is http://127.0.0.1:9200
    config :tirexs, :uri, "http://127.0.0.1:9200"
    

    See lib/tirexs/env.ex for more configuration options.

  3. Index a document:

import Tirexs.HTTP

put("/my_index/users/1", [name: "Jane", email: "[email protected]"])
# {:ok, 201,
#  %{_id: "1", _index: "my_index", _type: "users", _version: 1, created: true}}
  1. Fetch the document:
get("/my_index/users/1")
#  {:ok, 200,
#   %{_id: "1", _index: "my_index",
#     _source: %{email: "[email protected]", name: "Jane"}, _type: "users",
#     _version: 1, found: true}}
  1. Simplified search:
get("/my_index/users/_search?q=name:jane")
#  {:ok, 200,
#   %{_shards: %{failed: 0, successful: 5, total: 5},
#     hits: %{hits: [%{_id: "1", _index: "my_index", _score: 0.30685282,
#          _source: %{email: "[email protected]", name: "Jane"}, _type: "users"}],
#       max_score: 0.30685282, total: 1}, timed_out: false, took: 10}}
  1. Query DSL
import Tirexs.Search

query = search [index: "my_index"] do
  query do
    match "name", "jane"
  end
end
# [search: [query: [match: [name: [query: "jane"]]]], index: "my_index"]

Tirexs.Query.create_resource(query)
#  {:ok, 200,
#   %{_shards: %{failed: 0, successful: 5, total: 5},
#     hits: %{hits: [%{_id: "1", _index: "my_index", _score: 0.30685282,
#          _source: %{email: "[email protected]", name: "Jane"}, _type: "users"}],
#       max_score: 0.30685282, total: 1}, timed_out: false, took: 5}}

Check out /examples directory as a quick intro.

Gitter

tirexs is split into several layers

Find out more in api reference

Not sure?

Look around using https://hex.pm/packages?search=elasticsearch... to find out some other packages.

Contributing

If you feel like porting or fixing something, please drop a pull request or issue tracker at GitHub! Check out the CONTRIBUTING.md for more details.

License

Tirexs source code is released under Apache 2 License. Check LICENSE and NOTICE files for more details. The project HEAD is https://github.com/zatvobor/tirexs.

Analytics

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory