weavejester/clucy — pull request #22 by yxzhang (2013-09-02 07:36:58+00:00)
Title: numeric value and multivalue fields support

just like :

Numeric Types
--------------

You can add maps with numeric value to the index:

(clucy/add index
{:name "Bob", :age (int 20)}
{:name "Donald", :age (int 35)})

Once maps have been added, the index can be searched:

user=> (binding [clucy/*numeric-hints* {"age" "int"}]
(clucy/search index "age:20" 10))
({:age 20, :name "Bob"})

Or do range query just as :

user=> (binding [clucy/*numeric-hints* {"age" "int"}]
(clucy/search index "age:[32 TO 35]" 10))
({:age 35, :name "Donald"})

Numberic type can be one of int, long, double, float.

Multivalued Fields
--------------

You can use clojure collection to manage multivalued fields, eg.

(clucy/add index
{:name "Bob", :books ["Clojure Programming" "Clojure In Action"] }

user=> (search index "books:action" 10)
({:name "Bob", :books ["Clojure Programming" "Clojure In Action"]})