And the solr-ruby library handles this in the standard/dismax responses in this manner:

  def field_facets(field)
    facets = []
    values = @data['facet_counts']['facet_fields'][field]
    Solr::Util.paired_array_each(values) do |key, value|
      facets << FacetValue.new(key, value)
    end

    facets
  end

With a utility method that takes care of the paired array stuff.

Ultimately what I'd like to see is a response writer implementation designed specifically to work with the solr-ruby library to convey all the rich data structures that Solr emits, like ordered hashes, dates, etc.

See <http://issues.apache.org/jira/browse/SOLR-358>

So the short answer is, use solr-ruby, it'll do the right thing, and if it doesn't we'll fix it :)

        Erik


On Mar 10, 2008, at 8:22 PM, Yonik Seeley wrote:

On Mon, Mar 10, 2008 at 4:42 PM, Matt M. <[EMAIL PROTECTED]> wrote:
The sort order doesn't seem to work correctly when using the "map" (hash) type.

That's why it's not the default... I didn't want to put the burden of
re-sorting on the client.

-Yonik

Reply via email to