Ok, we got it. We have made a fix that is working for us handling the result.
Thanks for your time and responses around this! Regards, Mattias 2013/4/17 OJ Reeves <o...@buffered.io> > Hi guys, > > Russell is correct. In CI we gather the responses as they come in, in > whichever order they're received. We make some effort to flatten the > result, but we take the approach of being "smart enough to get you the > results, but no smarter". > > We don't do anything to reorder or manage the results in the way that the > HTTP interface does as we feel that's behaviour that the user of the > library should decide to implement should they desire it. > > HTH. > OJ > > > > On Wed, Apr 17, 2013 at 5:58 PM, Russell Brown <russell.br...@mac.com>wrote: > >> >> On 17 Apr 2013, at 08:54, Mattias Sjölinder <matt...@sjolinder.se> wrote: >> >> > Thanks for your help. Your query returned the same number over and over >> again just as expected. >> > >> > I think I have found the reason for my problem though. The client lib >> CorrugatedIron seems to wrap each document in the MapReduce result into a >> array turning the result into a nested array looking like: >> > [[{doc1}], [{doc2}], [{doc3}]] counting 3 arrays & 3 docs >> > and sometimes >> > [[{doc1}], [{doc2}, {doc3}]] counting 2 arrays and 2 docs (according to >> my client code... :) >> > >> > Why the result for same query in CorrugatedIron and for a simple curl >> differs I don't know but I will investigate it further. >> >> My guess is the client library streams the mapreduce results and gathers >> the separate messages. So depending on how many chunks are sent by riak you >> get a different nested array of responses. >> >> > >> > >> > Thanks again for your help! >> > >> > Best regards, >> > Mattias >> > >> > >> > >> > 2013/4/16 Christian Dahlqvist <christ...@basho.com> >> > Hi Mattias, >> > >> > The following curl query simply counts the number of inputs, and has >> worked well for me in the past. Can you please run it against the cluster a >> couple of times and see if it also return varying number of results? >> > >> > curl -XPOST http://localhost:8098/mapred >> > -H 'Content-Type: application/json' >> > -d '{"inputs":{ >> > "bucket":"som-bucket", >> > "index":"userid_bin", >> > "key":"18481123123" >> > }, >> > "query":[{"reduce":{"language":"erlang", >> > "module":"riak_kv_mapreduce", >> > "function":"reduce_count_inputs" >> > }}]}' >> > >> > Best regards, >> > >> > Christian >> > >> > >> > >> > >> > >> > On 16 Apr 2013, at 15:52, Mattias Sjölinder <matt...@sjolinder.se> >> wrote: >> > >> >> 18481123123 >> > >> > >> > _______________________________________________ >> > riak-users mailing list >> > riak-users@lists.basho.com >> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> >> >> _______________________________________________ >> riak-users mailing list >> riak-users@lists.basho.com >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> > > > > -- > > OJ Reeves > +61 431 952 586 > http://buffered.io/ >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com