                 (let [[eid & other-params] param]
                   (apply create-document (d/entity db eid) other-params))
                 (create-document (d/entity db param)))))
-       (format-bulk "update")
+       (format-bulk (:action (meta batch)))
        ((fn [formatted-bulk]
           (submit formatted-bulk :index index)))
        )

                         db)]
            (let [jobs (->> (map (fn [[v g]]
                                   [v gene/->Variation g]) v-g)
                            (make-batches 1000 :gene->variation))]
              (doseq [job jobs]
                (>!! scheduler job)))
            (let [jobs (->> (map (fn [[v g]]
                                   [g variation/->Gene v]) v-g)
                            (make-batches 1000 :variation->gene))]
              (doseq [job jobs]
                (>!! scheduler job)))

            )

          ;; close the channel to indicate no more input
          ;; existing jobs on the channel will remain available for consumers

  (let [url-prefix (if index
                     (format "%s/%s" es-base-url index)
                     es-base-url)]
    (http/post (format "%s/_bulk?refresh=%s" url-prefix (or refresh "false"))
               {:headers {:content-type "application/x-ndjson"}
                :body formatted-docs})))

