Class: Spotlight::Search
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spotlight::Search
- Includes:
- Blacklight::SolrHelper
- Defined in:
- app/models/spotlight/search.rb
Instance Method Summary collapse
Instance Method Details
#count ⇒ Object
18 19 20 |
# File 'app/models/spotlight/search.rb', line 18 def count query_solr(query_params, rows: 0, facet: false)['response']['numFound'] end |
#default_featured_image ⇒ Object
26 27 28 |
# File 'app/models/spotlight/search.rb', line 26 def default_featured_image images.first.last end |
#images ⇒ Object
22 23 24 |
# File 'app/models/spotlight/search.rb', line 22 def images query_solr(query_params, rows: 1000, fl: [blacklight_config.index.title_field, blacklight_config.index.thumbnail_field], facet: false)['response']['docs'].map {|result| [result[blacklight_config.index.title_field].first, result[blacklight_config.index.thumbnail_field].first]} end |