   (when-not (:quiet opts)
     (println (format "clj-opengrok> %s/%s" (:page opts) (:total-page opts)))))
 
-(defn- documents [^IndexSearcher searcher ^TopFieldDocs fdocs opts]
-  (let [hpp (hits-per-page)
-        n (* (dec (:page opts)) hpp)]
-    (page-info opts)
-    (map #(.doc searcher (.doc ^ScoreDoc %))
-         (take hpp (drop n (.scoreDocs fdocs))))))
-
 (defn- print-hit [^Hit hit]
-  (let [file (.getAbsolutePath (File. (get-root-path) (.getPath hit)))
+  (let [file (.getAbsolutePath (File. (root-path) (.getPath hit)))
         line-num (.getLineno hit)
         line (.getLine hit)]
     (println (str file ":" line-num ": "

(defn- search-single-database []
  (IndexSearcher. (DirectoryReader/open
                   (FSDirectory/open
                    (File. (str (get-data-root-path) "/index"))))))

(defn- searcher []
  (if (has-projects?)

(defn- subreaders [projects]
  (map #(DirectoryReader/open
         (FSDirectory/open
          (File. (str (data-root-path)
                      "/index" (.getPath ^Project %))))) projects))

(defn- search-multi-database [projects]
