diff --git a/code/solr/Solr.php b/code/solr/Solr.php index 98d3972..72a1305 100644 --- a/code/solr/Solr.php +++ b/code/solr/Solr.php @@ -1,8 +1,12 @@ =')) { $versionDefaults = array( - 'service' => 'Solr4Service', + 'service' => Solr4Service::class, 'extraspath' => Director::baseFolder().'/fulltextsearch/conf/solr/4/extras/', 'templatespath' => Director::baseFolder().'/fulltextsearch/conf/solr/4/templates/', ); } else { $versionDefaults = array( - 'service' => 'Solr3Service', + 'service' => Solr3Service::class, 'extraspath' => Director::baseFolder().'/fulltextsearch/conf/solr/3/extras/', 'templatespath' => Director::baseFolder().'/fulltextsearch/conf/solr/3/templates/', ); @@ -136,7 +140,7 @@ class Solr public static function get_indexes() { - return FullTextSearch::get_indexes('SolrIndex'); + return FullTextSearch::get_indexes(SolrIndex::class); } /** @@ -156,4 +160,4 @@ class Solr $included = true; } } -} \ No newline at end of file +} diff --git a/code/solr/SolrIndex.php b/code/solr/SolrIndex.php index 8884a4a..b9714fd 100644 --- a/code/solr/SolrIndex.php +++ b/code/solr/SolrIndex.php @@ -1,9 +1,20 @@ fulltextFields[$field])) { - throw new InvalidArgumentException("No fulltext field $field exists on ".$this->getIndexName()); + throw new \InvalidArgumentException("No fulltext field $field exists on ".$this->getIndexName()); } if ($level === null) { unset($this->boostedFields[$field]); @@ -578,7 +589,7 @@ abstract class SolrIndex extends SearchIndex foreach ($this->getClasses() as $searchclass => $options) { if ($searchclass == $class || ($options['include_children'] && is_subclass_of($class, $searchclass))) { - $base = ClassInfo::baseDataClass($searchclass); + $base = DataObject::getSchema()->baseDataClass($searchclass); $docs[] = $this->_addAs($object, $base, $options); } } @@ -743,7 +754,7 @@ abstract class SolrIndex extends SearchIndex $offset, $limit, $params, - Apache_Solr_Service::METHOD_POST + \Apache_Solr_Service::METHOD_POST ); $results = new ArrayList();