Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4516ae6
commit 565cf7d
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"}) |