Class: Hyrax::NestedCollectionsParentSearchBuilder
- Inherits:
-
CollectionSearchBuilder
- Object
- SearchBuilder
- CollectionSearchBuilder
- Hyrax::NestedCollectionsParentSearchBuilder
- Includes:
- FilterByType
- Defined in:
- app/search_builders/hyrax/nested_collections_parent_search_builder.rb
Overview
Searches for all collections that are parents of a given collection.
Instance Attribute Summary collapse
-
#child ⇒ Object
readonly
Returns the value of attribute child.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Attributes inherited from CollectionSearchBuilder
Instance Method Summary collapse
-
#initialize(scope:, child:, page:) ⇒ NestedCollectionsParentSearchBuilder
constructor
A new instance of NestedCollectionsParentSearchBuilder.
-
#parent_collections_only(solr_parameters) ⇒ void
Filters the query to only include the parent collections.
- #with_pagination(solr_parameters) ⇒ void
Methods included from FilterByType
Methods inherited from CollectionSearchBuilder
#add_sorting_to_solr, #discovery_permissions, #gated_discovery_filters, #models, #sort_field, #with_access
Constructor Details
#initialize(scope:, child:, page:) ⇒ NestedCollectionsParentSearchBuilder
Returns a new instance of NestedCollectionsParentSearchBuilder.
11 12 13 14 15 |
# File 'app/search_builders/hyrax/nested_collections_parent_search_builder.rb', line 11 def initialize(scope:, child:, page:) @child = child @page = page super(scope) end |
Instance Attribute Details
#child ⇒ Object (readonly)
Returns the value of attribute child.
7 8 9 |
# File 'app/search_builders/hyrax/nested_collections_parent_search_builder.rb', line 7 def child @child end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
7 8 9 |
# File 'app/search_builders/hyrax/nested_collections_parent_search_builder.rb', line 7 def limit @limit end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
7 8 9 |
# File 'app/search_builders/hyrax/nested_collections_parent_search_builder.rb', line 7 def page @page end |
Instance Method Details
#parent_collections_only(solr_parameters) ⇒ void
This method returns an undefined value.
Filters the query to only include the parent collections
23 24 25 26 |
# File 'app/search_builders/hyrax/nested_collections_parent_search_builder.rb', line 23 def parent_collections_only(solr_parameters) solr_parameters[:fq] ||= [] solr_parameters[:fq] += [process_fq] end |
#with_pagination(solr_parameters) ⇒ void
This method returns an undefined value.
33 34 35 |
# File 'app/search_builders/hyrax/nested_collections_parent_search_builder.rb', line 33 def with_pagination(solr_parameters) solr_parameters[:page] = page end |