Class: Esearch::Presenter::Search
- Inherits:
-
Esearch::Presenter
- Object
- Esearch::Presenter
- Esearch::Presenter::Search
- Defined in:
- lib/esearch/presenter/search.rb
Overview
Presenter for search result
Instance Method Summary collapse
-
#facets ⇒ Hash
private
Return facets.
-
#hits ⇒ Enumerable<Hash>
private
Return hits.
Instance Method Details
#facets ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return facets
14 15 16 17 18 |
# File 'lib/esearch/presenter/search.rb', line 14 def facets raw.fetch('facets', {}).each_with_object({}) do |(name, body), aggregate| aggregate[name] = Facet.build(body) end end |
#hits ⇒ Enumerable<Hash>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return hits
27 28 29 |
# File 'lib/esearch/presenter/search.rb', line 27 def hits Hits.new(raw.fetch('hits')) end |