Skip to content

Commit

Permalink
Fixed bug that caused the index to be overwritten on each add
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Mar 26, 2010
1 parent 565cf7d commit aa9fb2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/clucy/core.clj
Expand Up @@ -26,7 +26,7 @@
(defn- index-writer
"Create an IndexWriter."
[index]
(IndexWriter. index *analyzer* true IndexWriter$MaxFieldLength/UNLIMITED))
(IndexWriter. index *analyzer* IndexWriter$MaxFieldLength/UNLIMITED))

(defn- add-field
"Add a Field to a Document."
Expand Down Expand Up @@ -55,7 +55,8 @@
[index & maps]
(with-open [writer (index-writer index)]
(doseq [m maps]
(.addDocument writer (map->document m)))))
(.addDocument writer (map->document m)))
(.optimize writer)))

(defn- document->map
"Turn a Document object into a map."
Expand Down

0 comments on commit aa9fb2d

Please sign in to comment.