           (collect-pairs-of [tag record]
             (let [rtags (get-tags record)]
               (when (some #{tag} rtags)
-                (do (println tag "/" rtags)
-                    (remove #{tag} (get-tags record))))))]
+                (remove #{tag} (get-tags record)))))]
     (log/debug "Collecting tag pairs..." (count tags) "x" (count records))
     (reset! tag-pair-index
             (reduce #(assoc %1 %2
-                            (reduce concat []
-                                    (mapv (partial collect-pairs-of %2) records)))
+                            (set (reduce concat
+                                         []
+                                         (mapv (partial collect-pairs-of %2) records))))
                     {} tags))))
 
 (defn reload-index

    (collect-tag-pairs! tag-pair-index @tag-index @records)
    (log/info "Index ready")))

(defn do-search
  [{:keys [id] :as qs} index records tag-index tag-pair-index]
  (let [query (url-decode (:query qs))

                      (get @records rid)) results))
            ;;
            (not (clojure.string/blank? tag-query))
            (let [tag-results (filter #(.contains % tag-query) @tag-index)]
              (if (= 1 (count tag-results))
                (let [tag (first tag-results)]
                  (sort (concat tag-results (map #(str tag ", " %)
                                                 (get @tag-pair-index tag)))))
                (->> tag-results
                     (sort)
                     (sort (index-of-compare tag-query))))))
      [])))

(defn search-handler
