Module: GeoblacklightAdmin::PublicationStateSearchBehavior

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb

Instance Method Summary collapse

Instance Method Details

#publication_state_records(solr_params) ⇒ Blacklight::Solr::Request

Show/Hide records by publication state in search Defaults to “published” items only publication_state: [‘published’, ‘unpublished’, ‘draft’]

Parameters:

  • (Blacklight::Solr::Request)

Returns:

  • (Blacklight::Solr::Request)


17
18
19
20
21
22
23
24
# File 'app/models/concerns/geoblacklight_admin/publication_state_search_behavior.rb', line 17

def publication_state_records(solr_params)
  solr_params[:fq] ||= []
  solr_params[:fq] << if blacklight_params["publication_state"]
    "b1g_publication_state_s:#{blacklight_params["publication_state"]}"
  else
    "b1g_publication_state_s:published"
  end
end