diff --git a/config/vufind/website.ini b/config/vufind/website.ini index e1c038705160f0e145c384876d3dbb8d6b9ba73d..5f2082be5579234e2164dc7fdc39e5976207e070 100644 --- a/config/vufind/website.ini +++ b/config/vufind/website.ini @@ -24,3 +24,17 @@ title = sort_title category = "Category" linktype = "Link Type" subject = "Subject" + +[Results_Settings] +facet_limit = 30 ; how many values should we show for each facet? +; Should we show "exclude" links for some or all of the facets? Set to * for +; all facets, use a comma-separated list to show for some of the facets, set +; to false or omit to disable "exclude" links +;exclude = * + +; This section defines the location of the website Solr index; if it is omitted, +; a default_core of "website" will be used, and the url will be inherited from +; the [Index] section of config.ini. +;[Index] +;url = http://localhost:8080/solr +;default_core = website diff --git a/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php index 32e8169325eb393a42da4c3f11c7aa88c8aa652d..60caa4bfedd2e3609a7fa8fdf117071840bbb5f6 100644 --- a/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/SolrWebBackendFactory.php @@ -47,12 +47,37 @@ class SolrWebBackendFactory extends AbstractSolrBackendFactory public function __construct() { parent::__construct(); - $this->solrCore = 'website'; $this->searchConfig = 'website'; $this->searchYaml = 'websearchspecs.yaml'; $this->facetConfig = 'website'; } + /** + * Get the Solr core. + * + * @return string + */ + protected function getSolrCore() + { + $config = $this->config->get($this->searchConfig); + return isset($config->Index->default_core) + ? $config->Index->default_core : 'website'; + } + + /** + * Get the Solr URL. + * + * @return string + */ + protected function getSolrUrl() + { + // Allow the searchConfig to override the default config if set. + $webconfig = $this->config->get($this->searchConfig); + return isset($webconfig->Index->url) + ? $webconfig->Index->url . '/' . $this->getSolrCore() + : parent::getSolrUrl(); + } + /** * Create the SOLR backend. * diff --git a/module/VuFind/src/VuFind/Search/Solr/Params.php b/module/VuFind/src/VuFind/Search/Solr/Params.php index 16fb111dc22dd892a420f68cd4632f338e9baa53..08bff9dab5c877795adc18653a14fa0b59baeab9 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Params.php +++ b/module/VuFind/src/VuFind/Search/Solr/Params.php @@ -91,7 +91,7 @@ class Params extends \VuFind\Search\Base\Params { parent::__construct($options, $configLoader); // Use basic facet limit by default, if set: - $config = $configLoader->get('facets'); + $config = $configLoader->get($options->getFacetsIni()); if (isset($config->Results_Settings->facet_limit) && is_numeric($config->Results_Settings->facet_limit) ) {