Riak-Search Integration#32
Conversation
HTTP and PBC clients.
|
Thanks for putting this together, Casey! Great stuff. I've queued it up for review. Keep an eye out for comments/questions from Russell et al. Mark |
|
Hmmm - looks like I need to rewrite this for 0.15.0, so we can probably disregard this pull request! I'll get the new version up once I integrate 0.15 into my client library (call it a week or two). |
|
I could have done that happily for you. The low-level stuff is unchanged and backwards compatible so it is good to get this in at that level now, and we can add the RawCient and upwards stuff to it later...you mind if I re-open this? |
|
Heh, I re-opened it anyway. I'll have a look at merging this in tomorrow. Thanks again, sorry for the slow response. |
|
Thanks Russell - that's awesome. Is there anything I can do to help? |
|
Merged as part of pr #49. Many thanks for your contribution. |
I needed to be able to use a Riak-Search query as an input to a map/reduce job. This is supported by Riak, but had not yet been integrated into the Java version of the client. So I went ahead and bit the bullet :)
For both the HTTP and PBC clients, I have added support to MapReduceBuilder to allow for a "setSearch" method. This works collaboratively with "setBucket", but is mutually exclusive with objects or filters (much as objects and bucket were previously mutually exclusive).
I then added functionality to the HTTP RiakClient equivalent to the existing "mapReduceOverBucket" and "mapReduceOverObjects" - "mapReduceOverSearch" that takes a bucket and query string.
Finally I added unit tests for all of this functionality mirroring the unit test functionality that existed for other M/R functions. One of the unit tests - the itest for PBC search - is currently set to be ignored because PBC does not appear able to modify a bucket schema to add the necessary post-commit hooks for search (but the test is there and does work if you manually "install" search on the bucket).
Thanks!
Casey