Skip to content
Snippets Groups Projects
Commit ca28d9d2 authored by Samuli Sillanpää's avatar Samuli Sillanpää Committed by Robert Lange
Browse files

Read Connector/Backend classes from properties to ease extending the factory. (#1479)

parent dc935663
Branches
Tags
No related merge requests found
......@@ -127,6 +127,20 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface
*/
protected $uniqueKey = 'id';
/**
* Solr connector class
*
* @var string
*/
protected $connectorClass = Connector::class;
/**
* Solr backend class
*
* @var string
*/
protected $backendClass = Backend::class;
/**
* Constructor
*/
......@@ -168,7 +182,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface
*/
protected function createBackend(Connector $connector)
{
$backend = new Backend($connector);
$backend = new $this->backendClass($connector);
$backend->setQueryBuilder($this->createQueryBuilder());
$backend->setSimilarBuilder($this->createSimilarBuilder());
if ($this->logger) {
......@@ -341,7 +355,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface
array_push($handlers['select']['appends']['fq'], $filter);
}
$connector = new Connector(
$connector = new $this->connectorClass(
$this->getSolrUrl(), new HandlerMap($handlers), $this->uniqueKey
);
$connector->setTimeout(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment