   @doc false
   defmacro __using__(_) do
     quote do
-      import Analysis, only: [analysis: 1]
+      import Analysis, only: [settings: 1, settings: 2]
 
       Module.register_attribute(__MODULE__, :es_analyses, accumulate: true)
     end
   end
 
-  defmacro analysis([do: block]) do
-    es_analysis(__MODULE__, block)
+  defmacro settings([do: block]) do
+    es_analysis(__MODULE__, [], block)
   end
 
+  defmacro settings(options, [do: block]) do
+    es_analysis(__MODULE__, options, block)
+  end
+
+  defmacro settings(options) do
+  end
+
+  # imitational function.
+  defmacro analysis([do: block]), do: block
+
   @doc false
-  def es_analysis(_mod, block) do
+  def es_analysis(_mod, options, block) do
     quote do
       # mod = unquote(mod)
 

    escaped = Macro.escape(types)

    quote do
      def __es_analysis__(:to_map), do: %{analysis: Funcs.to_map(unquote(escaped))}
      def __es_analysis__(:as_json), do: __es_analysis__ :to_map
      def __es_analysis__(:types), do: unquote(escaped)
      unquote(quoted)
      def __es_analysis__(:type, _), do: nil
    end
  end


      analyses = @es_analyses |> Enum.reverse

      Module.eval_quoted __ENV__, [
        Analysis.__es_analyses__(analyses, unquote(options)),
      ]
    end
  end
