    entries))
 
 (defn make-id-map
+  "build a hashmap, mapping the :id of each entry to the entry itself"
   [entries]
   (apply hash-map (mapcat (juxt :id identity) entries)))
 
 (defn find-missing-entries
-  [existing-map entries]
+  "return a seq of entries missing in existing-map, uses :id of each
+entry for lookup in existing-map"
+ [existing-map entries]
   (remove #(contains? existing-map (:id %)) entries))
 
 (declare simplify-permissions-for-es)



(defn es-recursive-delete
  [index-name parent]
  (let [with-slash (misc/ensure-endswith-slash parent)]
    (esd/delete-by-query-across-all-types

     :mtime (-> fields :lastmodified lastmodified->mtime)}))

(defn enrich-es-entries
  "convert entries from es-listdir to our common format"
  [entries]
  (loop [entries entries]
    (if (map? entries)
