Deserialising nested Json into java object through Java -clinet

Santi Kumar santi at veradocs.com
Tue Apr 7 13:41:41 EDT 2015


Thanks Brian for the response. Yah we r trying to write that Jackson
deserialiser  for our object and was struck there as we r not much familiar
just want to check if there is a direct way. We will either try to share
with you or try solr client directly

Thanks
Santi
 On Apr 7, 2015 9:37 PM, "Brian Roach" <roach at basho.com> wrote:

> Santi,
>
> There is nothing in the Riak Java client to do that, no.
>
> The result of a search query over the Riak protocol buffers API
> returns the fields you queried for as a series of key/value pairs,
> with the value always being a string. This is unfortunate when it
> comes to mapping those values back to a class (or just serializing
> them to JSON) if there was any non-string values (numbers or null).
>
> The Java client presents a returned document as a Map<String,
> List<String>> for this reason, the list being required as there could
> be multiple values for a single key.
>
> That said, it shouldn't be too difficult to write a custom
> deserializer for Jackson if you know what the results are going to
> look like in advance. If you could show a dump of the Map being
> returned by the Riak client we may be able to help with that. Another
> option would be to use a Solr client and query Solr directly rather
> than going through Riak.
>
> Thanks,
> Brian Roach
>
>
>
>
> On Tue, Apr 7, 2015 at 8:32 AM, Santi Kumar <santi at veradocs.com> wrote:
> > Hi
> > We have a Composite pojo which we are indexing into Riak search. If I see
> > the structure of the object in solr web console, it shows as nested json.
> > Through java client when we query it returns the Map and having
> difficulties
> > in converting it into java object. Is there a way in riak-java client to
> > return a pojo instead of Map and we dealing with jakson mappers?
> >
> > Thanks
> > Santi
> >
> > _______________________________________________
> > riak-users mailing list
> > riak-users at lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20150407/bcd48b94/attachment-0002.html>


More information about the riak-users mailing list