     (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

  (: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)


(def root* (atom default-root))
(def identifier* (atom default-identifier))
(def name->smanager* (atom {}))

(def acceptable-name-pattern (re-pattern "[^a-zA-Z_0-9-]"))
(def shard-suffix "-shard-")
