Skip to content

elbow-jason/bus_car_dsl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BusCarDsl

Build Status

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:

def deps do
  [{:bus_car_dsl, "~> 0.1.3"}]
end

Documentation can be found at https://hexdocs.pm/bus_car_dsl.

Examples

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"}}}]}}}

About

A library than turns BusCarDsl lists into valid ElasticSearch JSON.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages