 (ns brainbot.nozzle.esconnect
+  (:require [clojure.string :as string])
   (:require [clojure.tools.logging :as logging])
   (:require [langohr.core :as rmq]
             [langohr.consumers :as lcons]

(defn es-listdir
  [index-name parent]
  (esd/search index-name
              "doc"
              :size 1000000
              :query {:match_all {}}
              :filter {:term {:parent parent}}))



(defn simple-update_directory
  [fs es-index {:keys [directory entries] :as body} {publish :publish}]
  (println "update-directory" body)

  (doseq [e (filter #(= (get-in % [:stat :type]) "directory") entries)]
    (let [id (string/join "/" [directory (:relpath e)])]
      (println "put" e)
      (esd/put es-index "dir"
               id
               {:mtime (get-in e [:stat :mtime])
                :parent directory}))))



(defn build-handle-connection
