lib/gummi/repository_layer/repository/result.rb in gummi-0.2.0 vs lib/gummi/repository_layer/repository/result.rb in gummi-0.2.1
- old
+ new
@@ -11,13 +11,16 @@
@documents = @search_result.documents
@converter = converter
end
def facets
+ return unless search_result.facets
@facets ||= begin
- response.facets.each_with_object({}) do |(name, content), facets|
- facets[name] = Hash[content.terms.map(&:values)]
+ result = {}
+ search_result.facets.each do |(name, content)|
+ result[name] = Hash[content.terms.map(&:values)]
end
+ Hashie::Mash.new result
end
end
def total
documents.total_entries
\ No newline at end of file