From 565cf7d7b3c60f01129ab980b3176a6496ef6817 Mon Sep 17 00:00:00 2001 From: weavejester Date: Fri, 26 Mar 2010 21:04:24 +0000 Subject: [PATCH] Added README --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..919e9e5 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +Clucy is a Clojure interface to [Lucene](http://lucene.apache.org/). + +Usage +----- + +To use Clucy, first require it: + + (ns example + (:require [clucy.core :as clucy])) + +Then create an index. You can use `(memory-index)`, which stores the search +index in RAM, or `(disk-index "/path/to/a-folder")`, which stores the index in +a folder on disk. + + (def index (clucy/memory-index)) + +Next, add Clojure maps to the index: + + (clucy/add index + {:name "Bob", :job "Builder"} + {:name "Donald", :job "Computer Scientist"}) + +Once maps have been added, the index can be searched: + + user=> (clucy/search index "bob" 10) + ({:name "Bob", :job "Builder"}) + + user=> (clucy/search index "scientist" 10) + ({:name "Donald", :job "Computer Scientist"})