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

Add support for querying CRDTs with Yokozuna #138

Merged
merged 37 commits into from Apr 3, 2015

Conversation

bkerley
Copy link
Contributor

@bkerley bkerley commented Mar 19, 2015

Existing:

client.search 'sets2', 'set:asdfasdfasd'
# returns:
{"max_score"=>0.712317943572998,
 "num_found"=>1,
 "docs"=>
  [{"score"=>"7.12317940000000038303e-01",
    "_yz_rb"=>"bryce",
    "_yz_rt"=>"sets",
    "_yz_rk"=>"asdf",
    "_yz_id"=>"1*sets*bryce*asdf*52"}]}

Desired:

idx = client.index 'sets2'
results = idx.search 'set:asdfasdfasd'
# results is an array-like collection
results.first #=> the actual set
results.docs.first #=> the docs entry

Looks figuring out that the results are a set type either involves probing an entry's content type (which breaks if a user lies and says something is a crdt when it isn't), or adding an API to read bucket type properties.

@bkerley bkerley self-assigned this Nov 21, 2014
@@ -61,6 +61,14 @@ def context?
!!@context
end

def ==(other)
return false unless other.is_a? Riak::Crdt::Base
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably also Care about matching classes between self and other.

@christophermancini
Copy link
Contributor

Tests pass. Code looks clean. Looks like there is good test coverage.

@christophermancini
Copy link
Contributor

👍 772165d

borshop added a commit that referenced this pull request Apr 3, 2015
Add support for querying CRDTs with Yokozuna

Reviewed-by: christophermancini
@bkerley
Copy link
Contributor Author

bkerley commented Apr 3, 2015

@borshop merge

@borshop borshop merged commit 772165d into master Apr 3, 2015
@seancribbs seancribbs deleted the bk-j66-yz-crdt-integration-new branch April 3, 2015 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants