     (str (as-str index) shard-suffix (str shard))))
 
 (defn reset-search-managers []
-  (doseq [[name ^SearcherManager manager] @mapping*]
+  (doseq [[name ^SearcherManager manager] @name->smanager*]
     (log/info "\tclosing: " name " " manager)
     (.close manager))
-  (reset! mapping* {}))
+  (reset! name->smanager* {}))
 
 (defn use-taxo-reader [index callback]
   ;; FIXME: reuse


(defn use-searcher [index callback]
  (let [manager (get-search-manager index)
        searcher (.acquire manager)]
    (try
      (use-taxo-reader index (fn [^DirectoryTaxonomyReader reader] (callback searcher reader)))
      (finally (.release manager searcher)))))

          (do
            (log/info (str index " maybeRefresh exception, closing it. Exception: " (ex-str e)))
            (.close manager)
            (swap! name->smanager* dissoc index)))))))

(defn shutdown []
  (locking name->smanager*
    (log/info "executing shutdown hook, current mapping: " @name->smanager*)
    (reset-search-managers)
    (log/info "mapping after cleanup: " @name->smanager*)))

(defn index-stat []
  (into {} (for [[name searcher] @name->smanager*]
             [name (use-searcher name
                                 (fn [^IndexSearcher searcher ^DirectoryTaxonomyReader taxo-reader]
                                   (let [reader (.getIndexReader searcher)]
