Class: CurationConcerns::CollectionSearchBuilder
- Inherits:
-
SearchBuilder
- Object
- SearchBuilder
- CurationConcerns::CollectionSearchBuilder
- Includes:
- FilterByType
- Defined in:
- app/search_builders/curation_concerns/collection_search_builder.rb
Overview
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, CurationConcerns::SearchFilters
Instance Attribute Summary collapse
-
#discovery_perms ⇒ Object
writeonly
TODO: remove this line.
Instance Method Summary collapse
-
#access_levels ⇒ Hash{Symbol => Array[Symbol]}
Bottom-up map of “what you need” to “what qualifies”.
-
#add_sorting_to_solr(solr_parameters) ⇒ Object
Sort results by title if no query was supplied.
-
#discovery_permissions ⇒ Object
unprotect lib/blacklight/access_controls/enforcement.rb methods Remove these when github.com/projectblacklight/blacklight-access_controls/pull/23 is merged/released/required.
- #discovery_permissions=(*args) ⇒ Object
-
#initialize ⇒ CollectionSearchBuilder
constructor
Defines which search_params_logic should be used when searching for Collections.
-
#models ⇒ Object
This overrides the models in FilterByType.
-
#sort_field ⇒ String
Solr field name indicating default sort order.
Methods included from FilterByType
Constructor Details
#initialize ⇒ CollectionSearchBuilder
Defines which search_params_logic should be used when searching for Collections
12 13 14 15 |
# File 'app/search_builders/curation_concerns/collection_search_builder.rb', line 12 def initialize(*) @rows = 100 super end |
Instance Attribute Details
#discovery_perms=(value) ⇒ Object (writeonly)
TODO: remove this line
28 29 30 |
# File 'app/search_builders/curation_concerns/collection_search_builder.rb', line 28 def discovery_perms=(value) @discovery_perms = value end |
Instance Method Details
#access_levels ⇒ Hash{Symbol => Array[Symbol]}
i.e., requiring :read access is satisfied by either :read or :edit access
Returns bottom-up map of “what you need” to “what qualifies”.
24 25 26 |
# File 'app/search_builders/curation_concerns/collection_search_builder.rb', line 24 def access_levels { read: [:read, :edit], edit: [:edit] } end |
#add_sorting_to_solr(solr_parameters) ⇒ Object
Sort results by title if no query was supplied. This overrides the default ‘relevance’ sort.
48 49 50 51 |
# File 'app/search_builders/curation_concerns/collection_search_builder.rb', line 48 def add_sorting_to_solr(solr_parameters) return if solr_parameters[:q] solr_parameters[:sort] ||= "#{sort_field} asc" end |
#discovery_permissions ⇒ Object
unprotect lib/blacklight/access_controls/enforcement.rb methods Remove these when github.com/projectblacklight/blacklight-access_controls/pull/23 is merged/released/required
33 34 35 |
# File 'app/search_builders/curation_concerns/collection_search_builder.rb', line 33 def @discovery_perms || super end |
#discovery_permissions=(*args) ⇒ Object
37 38 39 |
# File 'app/search_builders/curation_concerns/collection_search_builder.rb', line 37 def (*args) super end |
#models ⇒ Object
This overrides the models in FilterByType
42 43 44 |
# File 'app/search_builders/curation_concerns/collection_search_builder.rb', line 42 def models collection_classes end |
#sort_field ⇒ String
Returns Solr field name indicating default sort order.
18 19 20 |
# File 'app/search_builders/curation_concerns/collection_search_builder.rb', line 18 def sort_field Solrizer.solr_name('title', :sortable) end |