Solr

Setting up Solr on SSP

Note: Using Solr on SSP requires an additional server per environment to host the configuration and resources for Solr. If you require one, please talk to your account manager or contact the helpdesk.

Some SilverStripe stacks make use of the Solr search engine, if your stack does there are some prerequisites:

Firstly, The QueuedJobs and Fulltextsearch modules need to be installed.

The following configuration is required in mysite/_config.php:

Solr::configure_server(array(
	'host' => defined('SOLR_SERVER') ? SOLR_SERVER : 'localhost',
	'port' => defined('SOLR_PORT') ? SOLR_PORT : 8983,
	'path' => defined('SOLR_PATH') ? SOLR_PATH : '/solr/',
	'indexstore' => array(
		'mode' => defined('SOLR_MODE') ? SOLR_MODE : 'file',
		'auth' => defined('SOLR_AUTH') ? SOLR_AUTH : NULL,
		'path' => defined('SOLR_INDEXSTORE_PATH') ? SOLR_INDEXSTORE_PATH : BASE_PATH . '/.solr',
		'remotepath' => defined('SOLR_REMOTE_PATH') ? SOLR_REMOTE_PATH : null
	),
));

A cronjob is also required to run the queued fulltext search jobs, this can be added to .platform.yml for stacks using infrastructure version 3.3.0 and up for a base stack:

crons:
  queuedjobs_task:
    time: '* * * * *'
    command: 'test -f /var/www/mysite/www/host.txt && /usr/local/bin/sera 1 php /var/www/mysite/www/framework/cli-script.php dev/tasks/ProcessJobQueueTask'

For a virtual stack:

crons:
  queuedjobs_task:
    time: '* * * * *'
    command: 'test -f /var/www/<vstackName>/www/host.txt && /usr/local/bin/sera 1 php /var/www/<vstackName>/www/framework/cli-script.php dev/tasks/ProcessJobQueueTask'