Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numeric value and multivalue fields support #22

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

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