```ruby
@facets[facet] = result['constraints'].inject({}) { |hash, item| hash[item['value']] = item['count']; hash }
```