Skip to content

Commit

Permalink
Added README
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Mar 26, 2010
1 parent 4516ae6 commit 565cf7d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 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"})

0 comments on commit 565cf7d

Please sign in to comment.