Class: Blacklight::Document::GroupComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/blacklight/document/group_component.rb

Overview

Render the ‘more like this’ results from the response

Constant Summary

Constants inherited from Component

Component::EXCLUDE_VARIABLES

Instance Method Summary collapse

Methods inherited from Component

compiler, config, #inspect

Constructor Details

#initialize(group:, group_limit: -1)) ⇒ GroupComponent

Returns a new instance of GroupComponent.

Parameters:



11
12
13
14
# File 'app/components/blacklight/document/group_component.rb', line 11

def initialize(group:, group_limit: -1)
  @group = group
  @group_limit = group_limit
end

Instance Method Details

#add_group_facet_params_and_redirect(group) ⇒ Hash

Get path to a search within a grouped result set

Parameters:

Returns:

  • (Hash)


24
25
26
27
28
# File 'app/components/blacklight/document/group_component.rb', line 24

def add_group_facet_params_and_redirect(group)
  helpers.search_action_path(
    helpers.search_state.add_facet_params_and_redirect(group.field, group.key)
  )
end

#grouped_documentsObject



16
17
18
# File 'app/components/blacklight/document/group_component.rb', line 16

def grouped_documents
  helpers.render_document_index @group.docs
end