Bug on the 'facet_fields' response format???

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug on the 'facet_fields' response format???

Peter McPeterson
Hi all,

Was there an intended change on the 'facet_fields' response from Solr's
ruby/python format on the nightly build? Before it was returning a hash but
now it's returning an array. I'm assuming it's a bug...

before:
'facet_fields'=>{'category'=>{'TVs' => 2, 'Electronics' => 1}}

after
'facet_fields'=>{'category'=>['TVs',2,'Electronics',1]}

Thanks

_________________________________________________________________
Don’t miss your chance to WIN 10 hours of private jet travel from Microsoft®
Office Live http://clk.atdmt.com/MRT/go/mcrssaub0540002499mrt/direct/01/

Reply | Threaded
Open this post in threaded view
|

Re: Bug on the 'facet_fields' response format???

Yonik Seeley-2
On 2/27/07, Peter McPeterson <[hidden email]> wrote:
> Was there an intended change on the 'facet_fields' response from Solr's
> ruby/python format on the nightly build? Before it was returning a hash but
> now it's returning an array. I'm assuming it's a bug...

It was decided that too many clients couldn't maintain order (because
of mapping to unordered native maps/hashes).

See
http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?view=markup

'''The JSON response format for facets has changed to make it easier for
clients to retain sorted order.  Use json.nl=map explicitly in clients
to get the old behavior, or add it as a default to the request handler
in solrconfig.xml'''

or

http://wiki.apache.org/solr/SolJSON
where it explains that json.nl.flat is now the default.

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Bug on the 'facet_fields' response format???

Chris Hostetter-3
In reply to this post by Peter McPeterson

: Was there an intended change on the 'facet_fields' response from Solr's
: ruby/python format on the nightly build? Before it was returning a hash but
: now it's returning an array. I'm assuming it's a bug...

when upgrading Solr, it's always good to check the CHANGES.txt file --
even when using nightly builds, diffing them can tell you what's diferent.

this was added recently...

The JSON response format for facets has changed to make it easier for
clients to retain sorted order.  Use json.nl=map explicitly in clients
to get the old behavior, or add it as a default to the request handler
in solrconfig.xml



-Hoss