Class: Hyrax::CollectionSearchBuilder
- Inherits:
-
SearchBuilder
- Object
- SearchBuilder
- Hyrax::CollectionSearchBuilder
- Includes:
- FilterByType
- Defined in:
- app/search_builders/hyrax/collection_search_builder.rb
Overview
Note:
the default_processor_chain defined by Blacklight::Solr::SearchBuilderBehavior provides many possible points of override
Our parent class is the generated SearchBuilder descending from Blacklight::SearchBuilder It includes Blacklight::Solr::SearchBuilderBehavior, Hydra::AccessControlsEnforcement, Hyrax::SearchFilters
Direct Known Subclasses
Instance Method Summary collapse
-
#add_sorting_to_solr(solr_parameters) ⇒ Object
Sort results by title if no query was supplied.
-
#models ⇒ Object
This overrides the models in FilterByType.
-
#sort_field ⇒ String
Solr field name indicating default sort order.
Methods included from FilterByType
Instance Method Details
#add_sorting_to_solr(solr_parameters) ⇒ Object
Sort results by title if no query was supplied. This overrides the default ‘relevance’ sort.
24 25 26 27 |
# File 'app/search_builders/hyrax/collection_search_builder.rb', line 24 def add_sorting_to_solr(solr_parameters) return if solr_parameters[:q] solr_parameters[:sort] ||= "#{sort_field} asc" end |
#models ⇒ Object
This overrides the models in FilterByType
18 19 20 |
# File 'app/search_builders/hyrax/collection_search_builder.rb', line 18 def models collection_classes end |
#sort_field ⇒ String
Returns Solr field name indicating default sort order.
13 14 15 |
# File 'app/search_builders/hyrax/collection_search_builder.rb', line 13 def sort_field Solrizer.solr_name('title', :sortable) end |