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

  (:require [clojure.java.io :as io])
  (:import (java.io StringReader File)
           (java.lang OutOfMemoryError)
           (org.apache.lucene.analysis.tokenattributes CharTermAttribute)
           (org.apache.lucene.facet FacetsConfig FacetField FacetsCollector LabelAndValue)
           (org.apache.lucene.facet.taxonomy FastTaxonomyFacetCounts)
           (org.apache.lucene.facet.taxonomy.directory DirectoryTaxonomyWriter DirectoryTaxonomyReader)
           (org.apache.lucene.analysis Analyzer TokenStream)
           (org.apache.lucene.document Document Field Field$Index Field$Store
                                       IntField LongField FloatField DoubleField)
           (org.apache.lucene.search.highlight Highlighter QueryScorer
                                               SimpleHTMLFormatter TextFragment)
           (org.apache.lucene.index IndexWriter IndexReader Term IndexableField
                                    IndexWriterConfig DirectoryReader FieldInfo)
           (org.apache.lucene.search Query ScoreDoc SearcherManager IndexSearcher
                                     Explanation Collector TopScoreDocCollector
                                     TopDocsCollector MultiCollector FieldValueFilter)
           (org.apache.lucene.store NIOFSDirectory Directory)))

(declare use-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)]
