numeric value and multivalue fields support#22
Open
yxzhang wants to merge 27 commits intoweavejester:masterfrom
Open
numeric value and multivalue fields support#22yxzhang wants to merge 27 commits intoweavejester:masterfrom
yxzhang wants to merge 27 commits intoweavejester:masterfrom
Conversation
( @ )value of counter
field values for statistics (eg. sum, avg )
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"]})