Last active
February 1, 2017 16:10
-
-
Save radzserg/1053e1a85b6f1a35adf53b97eaf1e4a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule App.Es.EsQueryDsl do | |
| defstruct query: [], _source: %{include: ["id"]} | |
| def get_param(map, key) do | |
| val = Map.get(map, key) | |
| val = if val != "", do: val, else: nil | |
| if is_list(val) && length(val) == 0, do: nil, else: val | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment