From 695280e91e266977306980112759382a0e81943c Mon Sep 17 00:00:00 2001 From: Eduard Briem Date: Mon, 12 Sep 2016 11:38:52 +1200 Subject: [PATCH] adding ability to define different port for WebDAV than used for Solr (#126) * adding ability to define different port for WebDAV than used for Solr * removed spaces * added Solr configuration example to documentation --- code/solr/Solr.php | 1 + code/solr/SolrConfigStore.php | 2 +- docs/en/Solr.md | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/code/solr/Solr.php b/code/solr/Solr.php index 5687ecf..fb460fa 100644 --- a/code/solr/Solr.php +++ b/code/solr/Solr.php @@ -36,6 +36,7 @@ class Solr * When mode == SolrConfigStore_WebDAV or webdav (indexes should stored on a remote Solr server via webdav) * auth (default: none) - A username:password pair string to use to auth against the webdav server * path (default: /solrindex) - The suburl on the solr host that is set up to accept index configurations via webdav + * port (default: none) - The port for WebDAV if different from the Solr port * remotepath - The path that the Solr server will read the index configurations from */ protected static $solr_options = array(); diff --git a/code/solr/SolrConfigStore.php b/code/solr/SolrConfigStore.php index 86cc0a3..0f16439 100644 --- a/code/solr/SolrConfigStore.php +++ b/code/solr/SolrConfigStore.php @@ -94,7 +94,7 @@ class SolrConfigStore_WebDAV implements SolrConfigStore $this->url = implode('', array( 'http://', isset($config['auth']) ? $config['auth'].'@' : '', - $options['host'].':'.$options['port'], + $options['host'].':'.(isset($config['port']) ? $config['port'] : $options['port']), $config['path'] )); $this->remote = $config['remotepath']; diff --git a/docs/en/Solr.md b/docs/en/Solr.md index 60d9a2e..16a9373 100644 --- a/docs/en/Solr.md +++ b/docs/en/Solr.md @@ -49,6 +49,28 @@ by the user the Solr search server is started with (see below). ) )); +All possible parameters incl optional ones with example values: + + // File: mysite/_config.php: + 'localhost', // default: localhost | The host or IP Solr is listening on + 'port' => '8983', // default: 8983 | The port Solr is listening on + 'path' => '/solr' // default: /solr | The suburl the solr service is available on + 'version' => '4' // default: 4 | Solr server version - currently only 3 and 4 supported + 'service' => 'Solr4Service' // default: depends on version, Solr3Service for 3, Solr4Service for 4 | the class that provides actual communcation to the Solr server + 'extraspath' => BASE_PATH .'/fulltextsearch/conf/solr/4/extras/' // default: /fulltextsearch/conf/solr/{version}/extras/ | Absolute path to the folder containing templates which are used for generating the schema and field definitions. + 'templates' => BASE_PATH . '/fulltextsearch/conf/solr/4/templates/' // default: /fulltextsearch/conf/solr/{version}/templates/ | Absolute path to the configuration default files, e.g. solrconfig.xml + 'indexstore' => array( + 'mode' => 'file', // a classname which implements SolrConfigStore, or 'file' or 'webdav' + 'path' => BASE_PATH . '/.solr' // The (locally accessible) path to write the index configurations to OR The suburl on the solr host that is set up to accept index configurations via webdav + 'remotepath' => '/opt/solr/config' // default (file mode only): same as 'path' above | The path that the Solr server will read the index configurations from + 'auth' => 'solr:solr' // default: none | Webdav only - A username:password pair string to use to auth against the webdav server + 'port' => '80' // default: same as solr port | The port for WebDAV if different from the Solr port + ) + )); + + Note: We recommend to put the `indexstore.path` directory outside of the webroot. If you place it inside of the webroot (as shown in the example), please ensure its contents are not accessible through the webserver.