Skip to content

Conversation

@yxzhang
Copy link

@yxzhang yxzhang commented Sep 2, 2013

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"]})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant