Riak search. Different results (XML - JSON)

Vladimir Shapovalov shapovalov at gmail.com
Sun Aug 26 11:07:25 EDT 2012


Hey Olaf,

Thanks for the answer.

Yep, I know, it's JSON compliant.
The question is, why the unicode escaped sequences appear only in case of
searching and retrieveing in JSON? This is not the case in XML output.

If I just get the same key directly in JSON, the unicode chars are NOT
escaped.

Cheers
Vladimir

On Sun, Aug 26, 2012 at 4:55 PM, Olav Frengstad <olav at fwt.no> wrote:

> Hey,
>
> \00df is the unicode representation of ß. The JSON spec states that
> "Any character may be escaped" so it is valid JSON.
>
> Your JSON parser should handle this automatic.
>
> Cheers,
> Olav
> 2012/8/25 Vladimir Shapovalov <shapovalov at gmail.com>:
> > Hi all,
> >
> > I've a key in a bucket, witch is indexed.
> >
> > {
> > ...
> > "street":"Sabinastraße"
> > ...
> > }
> >
> > If I retrieve the key this way:
> > curl -i -v http://localhost:8098/buckets/is_solr/keys/123
> >
> > The response looks like:
> >
> > {
> > ...
> > "street":"Sabinastraße"
> > ...
> > }
> > which is correct.
> >
> > If I search for key and expect XML output:
> > curl -i -v
> > "
> http://localhost:8098/solr/is_solr/select?wt=xml&q=street:Sabinastra%C3%9Fe
> "
> >
> > Response:
> > <response>
> > ...
> > <result name="response" numFound="1" start="0" maxScore="0.353553">
> > <doc>
> > ...
> >   <str name="street">Sabinastraße</str>
> >   ...
> > </doc>
> > </result>
> > </response>
> >
> > wich is also correct.
> >
> > But in case the format of the output is JSON:
> > curl -i -v
> > "
> http://localhost:8098/solr/is_solr/select?wt=json&q=street:Sabinastra%C3%9Fe
> "
> >
> > result looks differently:
> > ...
> > "street":"Sabinastra\u00dfe"
> > ...
> >
> > Why is the JSON response looks differently then XML?
> > Is it an expected output or I'm doing something wrong?
> >
> > Thanks in advance!
> > Vladimir
> >
> > _______________________________________________
> > riak-users mailing list
> > riak-users at lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
>
>
> --
> Med Vennlig Hilsen
> Olav Frengstad
>
> Systemutvikler // FWT
> +47 920 42 090
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120826/28e5d350/attachment.html>


More information about the riak-users mailing list