https://github.com/elbow-jason/bus_car_dsl
A library than turns BusCarDsl lists into valid ElasticSearch JSON.
https://github.com/elbow-jason/bus_car_dsl
dsl elasticsearch elixir
Last synced: about 2 months ago
JSON representation
A library than turns BusCarDsl lists into valid ElasticSearch JSON.
- Host: GitHub
- URL: https://github.com/elbow-jason/bus_car_dsl
- Owner: elbow-jason
- License: mit
- Created: 2017-03-28T18:33:52.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-07T01:52:59.000Z (about 9 years ago)
- Last Synced: 2026-04-03T11:14:04.135Z (3 months ago)
- Topics: dsl, elasticsearch, elixir
- Language: Elixir
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BusCarDsl
[](https://travis-ci.org/elbow-jason/bus_car_dsl)
**A Domain Specific Language for composing ElasticSearch queries without all the nesting.**
## Installation
The package can be installed
by adding `bus_car_dsl` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:bus_car_dsl, "~> 0.1.3"}]
end
```
Documentation can be found at [https://hexdocs.pm/bus_car_dsl](https://hexdocs.pm/bus_car_dsl).
## Examples
```elixir
iex> BusCarDsl.parse([:query, :bool, :must, :range, "age", :gte, 18, :must_not, :match, "likes", "dogs", [boost: 2.0], :fuzzy, "name", "jason", [fuzziness: 2]])
%{query: %{bool: %{must: [%{range: %{"age" => %{gte: 18}}}],
must_not: [%{fuzzy: %{"name" => %{fuzziness: 2, value: "jason"}}},
%{match: %{"likes" => %{boost: 2.0, query: "dogs"}}}]}}}
```