Sha256: c000e7c06094de87974dbe2f15171df17ccf339d165e28676052d8ca511aea77

Contents?: true

Size: 1.11 KB

Versions: 61

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

##
# Simplified catalog controller
class CatalogController < ApplicationController
  include Blacklight::Catalog

  configure_blacklight do |config|
    ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
    config.default_solr_params = {
      qt: 'search',
      rows: 10,
      fl: '*'
    }

    config.document_solr_path = 'get'
    config.document_unique_id_param = 'ids'

    # solr field configuration for search results/index views
    config.index.title_field = 'full_title_tesim'

    config.add_search_field 'all_fields', label: I18n.t('spotlight.search.fields.search.all_fields')

    config.add_sort_field 'relevance', sort: 'score desc', label: I18n.t('spotlight.search.fields.sort.relevance')

    config.add_field_configuration_to_solr_request!

    # enable facets:
    # https://github.com/projectblacklight/spotlight/issues/1812#issuecomment-327345318
    config.add_facet_fields_to_solr_request!

    # Set which views by default only have the title displayed, e.g.,
    # config.view.gallery.title_only_by_default = true
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
blacklight-spotlight-3.6.0.beta10 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.6.0.beta9 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.6.0.beta8 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.5.0.4 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.6.0.beta7 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.5.0.3 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.6.0.beta6 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.6.0.beta5 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.6.0.beta4 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.6.0.beta3 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.6.0.beta1 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.5.0.2 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.5.0.1 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.5.0 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.4.4.1 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.4.4 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.4.3 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.4.2.2 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.4.2.1 lib/generators/spotlight/templates/catalog_controller.rb
blacklight-spotlight-3.4.2 lib/generators/spotlight/templates/catalog_controller.rb