 
 (defn write-log
   [log-id deployment-id document]
-  (esd/create @conn index-name log-type (dissoc document :id) :id log-id :parent deployment-id :refresh true))
+  (esd/put @conn index-name log-type log-id (dissoc document :id) :parent deployment-id :refresh true))
 
 (defn nil-if-no-deployment
   [deployment-id results]


(defn create-task
  [task-id deployment-id document]
  (esd/create @conn index-name task-type (dissoc document :id) :id task-id :parent deployment-id :refresh true))

(defn update-task
  [task-id deployment-id partial-document]


(defn deployment-tasks
  [deployment-id]
  (nil-if-no-deployment deployment-id (->> (esd/search @conn index-name task-type :query (q/match-all) :filter (parent-filter deployment-type deployment-id) :sort {:sequence "asc"} :size 10000)
                                           esrsp/hits-from
                                           (map (fn [h] (assoc (:_source h) :id (:_id h))))
                                           (map #(dissoc % :sequence)))))
