         create_index schema, index: newidx
 
         # Import
-        __MODULE__.import(schema, opts)
+        __MODULE__.import(schema, index: newidx)
 
         # Changes alias
         Indices.update_aliases transport, %{body: %{

        delete_index schema, index: oldidx
      end

      # TODO: change keyword to opts
      def import(schema, opts \\ []) do
        mod  = Funcs.to_mod schema


        makeidx       = & "#{&1}_#{:os.system_time}"
        mod           = Funcs.to_mod schema
        {index, opts} = Keyword.pop opts, :index, mod.__es_naming__(:index_name)

        # create new index if cluster doesn't have that.
        case Indices.get_alias(transport, index: index) do
          {:error, _} ->
            newidx = makeidx.(index)

            create_index schema, index: newidx

            Indices.put_alias transport, %{name: index, index: newidx}
          _ ->
            nil
        end

        newidx = makeidx.(index)
