elixir elasticsearch example

July 14, 2016 ยท View on GitHub

env = Application.get_env(:requesters, :environment) if env == "prod" do env = "production" end

index = [index: "timelines-#{env}", type: "Timeline"]

use Tirexs.Mapping

mappings do indexes "name", type: "string" indexes "artist", type: "string" indexes "description", type: "string" end

Tirexs.Mapping.create_resource(index)