Created
February 12, 2015 13:22
-
-
Save bkerley/e81567ad4fea9e83532d to your computer and use it in GitHub Desktop.
RFC: Yokozuna and CRDTs in Ruby
This file contains 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
# the nice thing about this improved yz api is that it's not released yet! i can | |
# do anything, i'm the master of time! | |
# this is how we search pretty much anything | |
query = Riak::Search::Query.new client, index, 'cool search term' | |
results = query.results # actually hits riak, gives us a ResultsCollection | |
# existing robject functionality | |
robject_md = results.docs[0] | |
# equivalent | |
robject = robject_md.robject | |
robject = results[0] | |
# perhaps? | |
robject = results.robjects[0] | |
# result.docs is a collection of ResultsDocuments, each of which is a hash | |
# from the yz results | |
map_md = results.docs[1] | |
# call out to riak and load that map | |
map = map_md.map | |
map = results.maps.first | |
# raise an error | |
set = map_md.set | |
# raise an error? | |
robject = map_md.robject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fetching maps this way seems good to me as well.