     (if (.isDirectory f)
       (get-search-manager (.getName f)))))
 
-(defn use-search-manager [name f]
+(defn use-searcher-from-search-manager [name f]
   (let [manager (get-search-manager name)
         searcher (.acquire manager)]
     (try

    (search (:index input) (:query input) (:size input))))

(defn handler [request]
  {:status 200
   :headers {"Content-Type" "application/json"}
   :body (json/write-str (work (:request-method request) (json/read-str (slurp (:body request)) :key-fn keyword))) } )

(def tp (mk-pool))
(defn main []



(defn search [name query size]
  (use-searcher-from-search-manager name (fn [searcher]
                             (let [parser (QueryParser. *version* "_default_" *analyzer*)
                                   query (.parse parser query)
                                   hits (.search searcher query (int size))
