Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param MongoDB $db       Database connection
  * @param string  $basePath RecordManager main directory
  * @param object  $log      Logger
  * @param boolean $verbose  Whether to output verbose messages
  *
  * @throws Exception
  */
 public function __construct($db, $basePath, $log, $verbose)
 {
     parent::__construct($db, $basePath, $log, $verbose);
     if (empty($this->settings['_preview'])) {
         $this->settings['_preview'] = ['institution' => '_preview', 'componentParts' => null, 'format' => '_preview', 'preTransformation' => 'strip_namespaces.xsl', 'extraFields' => [], 'mappingFiles' => []];
     }
     if (empty($this->settings['_marc_preview'])) {
         $this->settings['_marc_preview'] = ['institution' => '_preview', 'componentParts' => null, 'format' => 'marc', 'extraFields' => [], 'mappingFiles' => []];
     }
 }
Exemplo n.º 2
0
 /**
  * Count distinct values in the specified field (that would be added to the
  * Solr index)
  *
  * @param string $sourceId Source ID
  * @param string $field    Field name
  * @param bool   $mapped   Whether to count values after any mapping files are
  *                         are processed
  *
  * @return void
  */
 public function countValues($sourceId, $field, $mapped)
 {
     if (!$field) {
         echo "Field must be specified\n";
         exit;
     }
     $updater = new SolrUpdater($this->db, $this->basePath, $this->log, $this->verbose, $this->cursorTimeout);
     $updater->countValues($sourceId, $field, $mapped);
 }