Пример #1
0
 /**
  * Create the SOLR backend.
  *
  * @param Connector $connector Connector
  *
  * @return Backend
  */
 protected function createBackend(Connector $connector)
 {
     //return parent::createBackend($connector);
     //we can't use zje original funtion because Backend is overwritten by Swissbib
     //look at it later if really necessary
     //$config  = $this->config->get('config');
     $backend = new Backend($connector);
     $backend->setQueryBuilder($this->createQueryBuilder());
     // Spellcheck
     //if (isset($config->Spelling->enabled) && $config->Spelling->enabled) {
     //    if (isset($config->Spelling->simple) && $config->Spelling->simple) {
     //        $dictionaries = array('basicSpell');
     //    } else {
     //        $dictionaries = array('default', 'basicSpell');
     //    }
     //    $backend->setDictionaries($dictionaries);
     //}
     if ($this->logger) {
         $backend->setLogger($this->logger);
     }
     $manager = $this->serviceLocator->get('VuFind\\RecordDriverPluginManager');
     $factory = new RecordCollectionFactory(array($manager, 'getSolrRecord'));
     $backend->setRecordCollectionFactory($factory);
     return $backend;
 }
Пример #2
0
 /**
  * @return void
  */
 public function testResponseDataFormat()
 {
     $backend = new Backend($this->getConnector('select'));
     $result = $backend->search(new Query(), 0, 100, $this->getParamBag());
     $this->assertTrue($result instanceof RecordCollection, 'Response is of Type Json\\RecordCollection.');
 }